Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
type AccessLog struct {
// Old format (for backward compatibility)
Level string `json:"level"`
Ts float64 `json:"ts"`
Logger string `json:"logger"`
Msg string `json:"msg"`
Request struct {
RemoteIP string `json:"remote_ip"`
RemotePort string `json:"remote_port"`
Proto string `json:"proto"`
Method string `json:"method"`
Host string `json:"host"`
URI string `json:"uri"`
Headers map[string][]string `json:"headers"`
} `json:"request"`
UserID string `json:"user_id"`
Duration float64 `json:"duration"`
Size int `json:"size"`
Status int `json:"status"`
RespHeaders struct {
ContentType []string `json:"Content-Type"`
Server []string `json:"Server"`
} `json:"resp_headers"`
// New Traefik format (Swarm mode)
ClientAddr string `json:"ClientAddr"`
ClientHost string `json:"ClientHost"`
DownstreamStatus int `json:"DownstreamStatus"`
RequestMethod string `json:"RequestMethod"`
RequestPath string `json:"RequestPath"`
RequestProtocol string `json:"RequestProtocol"`
RequestHost string `json:"RequestHost"`
ServiceName string `json:"ServiceName"`
OriginDuration int64 `json:"OriginDuration"` // nanoseconds
OriginContentSize int64 `json:"OriginContentSize"`
Time string `json:"time"`
DownstreamContentSize int64 `json:"DownstreamContentSize"`
}
AccessLog represents a JSON access log entry (Traefik format)
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter handles formatting of access logs
func NewFormatter ¶
NewFormatter creates a new log formatter
func (*Formatter) FormatHeader ¶
FormatHeader returns a formatted header for the log output
func (*Formatter) FormatLine ¶
FormatLine formats a single JSON log line into human-readable output
func (*Formatter) SetServiceFilter ¶
SetServiceFilter sets a filter to only show logs for a specific service
Click to show internal directories.
Click to hide internal directories.