Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶ added in v0.2.0
type Option struct {
// contains filtered or unexported fields
}
Option configures the logging middleware.
func WithClientErrorLevel ¶ added in v0.2.0
WithClientErrorLevel sets the log level for 4xx responses. The default is DebugLevel.
func WithRedirectionLevel ¶ added in v0.2.0
WithRedirectionLevel sets the log level for 3xx responses. The default is DebugLevel.
func WithReferrer ¶ added in v0.2.1
func WithReferrer() Option
WithReferrer adds a referrer field to the logger with the value of *http.Request.Referer().
func WithRemoteAddr ¶ added in v0.2.1
func WithRemoteAddr() Option
WithRemoteAddr adds a remote_addr field to the logger with the value of *http.Request.RemoteAddr.
func WithServerErrorLevel ¶ added in v0.2.0
WithServerErrorLevel sets the log level for 5xx responses. The default is ErrorLevel.
func WithSuccessLevel ¶ added in v0.2.0
WithSuccessLevel sets the log level for 2xx responses. The default is DebugLevel.
func WithUserAgent ¶ added in v0.2.1
func WithUserAgent() Option
WithUserAgent adds a user_agent field to the logger with the value of *http.Request.UserAgent().