Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogTypeDebug = "debug" LogTypeInfo = "info" LogTypeWarn = "warn" LogTypeError = "error" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessLog ¶
type AccessLog struct {
Level string `cfg:"level"`
Message string `cfg:"message"`
// SkipSSE disables access logging for SSE (text/event-stream) requests.
// Default is true (SSE logging is skipped). Set to false to enable SSE logging.
SkipSSE *bool `cfg:"skip_sse"`
Path Path `cfg:"path"`
LogDetails LogDetails `cfg:"log_details"`
}
func (*AccessLog) Middleware ¶
type Check ¶
type Check struct {
URL string `cfg:"url"`
// Method is the HTTP method to check for, default all methods "*"
Methods []string `cfg:"methods"`
LogDetails *LogDetails `cfg:"log_details"`
// contains filtered or unexported fields
}
type LogDetails ¶
type LogDetails struct {
// RequestBody is the request body to log default true
RequestBody *bool `cfg:"request_body"`
// RequestBodySize is the maximum size of the request body to log
// default is 512 (bytes), 0 means no limit
RequestBodySize int `cfg:"request_body_size"`
// ResponseBody is the response body to log default true
ResponseBody *bool `cfg:"response_body"`
// ResponseBodySize is the maximum size of the response body to log
// default is 512 (bytes), 0 means no limit
ResponseBodySize int `cfg:"response_body_size"`
// Headers is the headers to log default true
Headers *bool `cfg:"headers"`
// SanitizeHeaders is a list of headers to sanitize before logging.
// Default added Authorization, Cookie, Set-Cookie
// and X-Forwarded-For headers.
// The headers will be sanitized to [REDACTED]
SanitizeHeaders []string `cfg:"sanitize_headers"`
}
func (*LogDetails) Default ¶
func (l *LogDetails) Default()
func (*LogDetails) GetHeaders ¶
func (l *LogDetails) GetHeaders() bool
func (*LogDetails) GetRequestBody ¶
func (l *LogDetails) GetRequestBody() bool
func (*LogDetails) GetResponseBody ¶
func (l *LogDetails) GetResponseBody() bool
Click to show internal directories.
Click to hide internal directories.