Documentation ¶
Index ¶
Constants ¶
View Source
const ( PktSetInfo = 0x0100 // set the process name/etc. {"name":"..."} PktLogJson = 0x0101 // {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} PktPipeRequest = 0x0200 // request a pipe from the daemon PktPipeResponse = 0x8200 // pipe provided )
Variables ¶
View Source
var DefaultReceiver = PostReceiver("https://ws.atonline.com/_special/rest/SLog:append")
Functions ¶
Types ¶
type LogAgent ¶ added in v0.3.1
type LogAgent struct {
// contains filtered or unexported fields
}
func NewLogAgent ¶ added in v0.3.3
func NewLogAgent() *LogAgent
func (*LogAgent) GetLogfile ¶ added in v0.3.3
GetLogfile returns a write-only os.File that can be used when using os/exec to start daemons.
Remember to close the os.File after calling Start.
type Packet ¶ added in v0.3.1
type Packet struct { Type uint16 Flags uint32 Data []byte FDs []*os.File // files to be passed (optional) }
Packet is a wire protocol packet sent to the local logagent
type PostReceiver ¶ added in v0.3.1
type PostReceiver string
func (PostReceiver) ProcessLogs ¶ added in v0.3.1
func (p PostReceiver) ProcessLogs(logs []map[string]string) error
type RequestLogHandler ¶ added in v0.2.0
RequestLogHandler is a http handler that will log every requests it handles into slog. It will also update request.Context to return the request information so it will be populated in messages sent via slog.
func (*RequestLogHandler) ServeHTTP ¶ added in v0.2.0
func (r *RequestLogHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.