requestlogger

package
v0.0.0-...-7aa6a20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger *zap.Logger, opts ...Option) func(h http.Handler) http.Handler

Types

type ContextFunc

type ContextFunc func(panic any, r *http.Request) []zapcore.Field

type IPAnonymizationConfig

type IPAnonymizationConfig struct {
	Enabled bool
	Method  IPAnonymizationMethod
}

Option provides a functional approach to define configuration for a handler; such as setting the logging whether to print stack traces on panic.

type IPAnonymizationMethod

type IPAnonymizationMethod string
const (
	Hash   IPAnonymizationMethod = "hash"
	Redact IPAnonymizationMethod = "redact"
)

type Option

type Option func(handler *handler)

Option provides a functional approach to define configuration for a handler; such as setting the logging whether to print stack traces on panic.

func WithAnonymization

func WithAnonymization(ipConfig *IPAnonymizationConfig) Option

func WithDefaultOptions

func WithDefaultOptions() Option

func WithFields

func WithFields(fields ...zapcore.Field) Option

func WithFieldsHandler

func WithFieldsHandler(fn ContextFunc) Option

func WithNoTimeField

func WithNoTimeField() Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL