slogx

package
v0.0.153 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureDefaultSensitiveHeaders

func ConfigureDefaultSensitiveHeaders()

ConfigureDefaultSensitiveHeaders configures a default set of sensitive headers to be redacted in the logs.

func ConfigureIncludeQuery

func ConfigureIncludeQuery(include bool)

ConfigureIncludeQuery sets whether to include query parameters in the logs. Defaults to false

func ConfigureRedactionText

func ConfigureRedactionText(text string)

ConfigureRedactionText sets the text that will be used to redact sensitive headers in the logs. Default is "**[REDACTED]**" Note that this will be applied globally to all loggers using slogx.

func ConfigureSensitiveHeaders

func ConfigureSensitiveHeaders(sensitiveHeaders ...string)

ConfigureSensitiveHeaders sets the headers that should be redacted in the logs. Note that this will be applied globally to all loggers using slogx.

func ErrorAttr

func ErrorAttr(err error) slog.Attr

func ErrorsAttr

func ErrorsAttr(errs ...error) slog.Attr

func NewLogFields

func NewLogFields(kvs ...attribute.KeyValue) []slog.Attr

func NewRequestIDExtractor

func NewRequestIDExtractor(requestIDContextKey interface{}, requestIDFieldKey string) slogctx.AttrExtractor

func RedactHeaders

func RedactHeaders(headers http.Header) slog.Attr

func WithRequest

func WithRequest(sl *slog.Logger, r *http.Request) *slog.Logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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