logging

package
v0.0.0-...-d4c952b Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cfg config.LoggingConfig)

Init configures the global logger based on configuration values.

func L

func L() *zerolog.Logger

L returns the base logger.

func RequestContextMiddleware

func RequestContextMiddleware(cfg config.LoggingConfig) func(http.Handler) http.Handler

RequestContextMiddleware injects request/trace identifiers into the request context.

func RequestHeaderName

func RequestHeaderName(cfg config.LoggingConfig) string

RequestHeaderName returns the configured request header name, falling back to default.

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

RequestIDFromContext extracts the request identifier from context if present.

func TraceHeaderName

func TraceHeaderName(cfg config.LoggingConfig) string

TraceHeaderName returns the configured trace header name, falling back to default.

func TraceIDFromContext

func TraceIDFromContext(ctx context.Context) string

TraceIDFromContext extracts the trace identifier from context if present.

func WithContext

func WithContext(ctx context.Context) *zerolog.Logger

WithContext returns a logger enriched with request scoped metadata.

Types

This section is empty.

Jump to

Keyboard shortcuts

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