skipper: github.com/zalando/skipper/filters/accesslog Index | Files

package accesslog

import "github.com/zalando/skipper/filters/accesslog"

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

Package Files

control.go disable.go doc.go

Constants

const (
    // DisableAccessLogName is the filter name seen by the user
    DisableAccessLogName = "disableAccessLog"

    // EnableAccessLogName is the filter name seen by the user
    EnableAccessLogName = "enableAccessLog"

    // AccessLogEnabledKey is the key used in the state bag to pass the access log state to the proxy.
    AccessLogEnabledKey = "statebag:access_log:proxy:enabled"
)
const (
    // AccessLogDisabledName is the filter name seen by the user
    AccessLogDisabledName = "accessLogDisabled"
)

func NewAccessLogDisabled Uses

func NewAccessLogDisabled() filters.Spec

NewAccessLogDisabled creates a filter spec for overriding the state of the AccessLogDisabled setting. (By default global setting is used.)

accessLogDisabled("false")

Deprecated: use disableAccessLog or enableAccessLog

func NewDisableAccessLog Uses

func NewDisableAccessLog() filters.Spec

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 Uses

func NewEnableAccessLog() filters.Spec

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

type AccessLogFilter Uses

type AccessLogFilter struct {
    Enable   bool
    Prefixes []int
}

Common filter struct for holding access log state

func (*AccessLogFilter) Request Uses

func (al *AccessLogFilter) Request(ctx filters.FilterContext)

func (*AccessLogFilter) Response Uses

func (*AccessLogFilter) Response(filters.FilterContext)

Package accesslog imports 1 packages (graph) and is imported by 4 packages. Updated 2019-02-19. Refresh now. Tools for package owners.