Documentation
¶
Index ¶
- func ConfigureDefaultSensitiveHeaders()
- func ConfigureIncludeQuery(include bool)
- func ConfigureRedactionText(text string)
- func ConfigureSensitiveHeaders(sensitiveHeaders ...string)
- func ErrorAttr(err error) slog.Attr
- func ErrorsAttr(errs ...error) slog.Attr
- func NewLogFields(kvs ...attribute.KeyValue) []slog.Attr
- func NewRequestIDExtractor(requestIDContextKey interface{}, requestIDFieldKey string) slogctx.AttrExtractor
- func RedactHeaders(headers http.Header) slog.Attr
- func WithRequest(sl *slog.Logger, r *http.Request) *slog.Logger
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 ErrorsAttr ¶
func NewRequestIDExtractor ¶
func NewRequestIDExtractor(requestIDContextKey interface{}, requestIDFieldKey string) slogctx.AttrExtractor
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.