Documentation ¶
Overview ¶
Package accesslog provides request filters that give the ability to override AccessLogDisabled setting.
How It Works ¶
There are two filters that change the state of access log "disableAccessLog" and "enableAccessLog". If "disableAccessLog" is present access log entries for this route won't be produced even if global AccessLogDisabled is false. Otherwise, if "enableAccessLog" filter is present access log entries for this route will be produced even if global AccessLogDisabled is true.
Usage
enableAccessLog() disableAccessLog()
Note: accessLogDisabled("true") filter is deprecated in favor of "disableAccessLog" and "enableAccessLog"
Index ¶
Constants ¶
const ( // Deprecated, use filters.DisableAccessLogName instead DisableAccessLogName = filters.DisableAccessLogName // Deprecated, use filters.EnableAccessLogName instead EnableAccessLogName = filters.EnableAccessLogName // AccessLogEnabledKey is the key used in the state bag to pass the access log state to the proxy. AccessLogEnabledKey = "statebag:access_log:proxy:enabled" // AccessLogAdditionalDataKey is the key used in the state bag to pass extra data to access log AccessLogAdditionalDataKey = "statebag:access_log:additional" )
const (
// Deprecated: use DisableAccessLogName or EnableAccessLogName
AccessLogDisabledName = "accessLogDisabled"
)
Variables ¶
This section is empty.
Functions ¶
func NewAccessLogDisabled
deprecated
func NewDisableAccessLog ¶ added in v0.10.113
NewDisableAccessLog creates a filter spec to disable access log for specific route. Optionally takes in response code prefixes as arguments. When provided, access log is disabled only if response code matches one of the arguments.
disableAccessLog() or disableAccessLog(1, 20, 301) to disable logs for 1xx, 20x and 301 codes
func NewEnableAccessLog ¶ added in v0.10.113
NewEnableAccessLog creates a filter spec to enable access log for specific route Optionally takes in response code prefixes as arguments. When provided, access log is enabled only if response code matches one of the arguments.
enableAccessLog() enableAccessLog(1, 20, 301) to enable logs for 1xx, 20x and 301 codes
Types ¶
type AccessLogFilter ¶ added in v0.10.157
Common filter struct for holding access log state
func (*AccessLogFilter) Request ¶ added in v0.10.157
func (al *AccessLogFilter) Request(ctx filters.FilterContext)
func (*AccessLogFilter) Response ¶ added in v0.10.157
func (*AccessLogFilter) Response(filters.FilterContext)