Documentation
¶
Index ¶
Constants ¶
View Source
const ( TraceIDKey contextKey = "ns_trace_id" UserIDKey contextKey = "ns_user_id" )
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
InitLogger initializes the global slog logger with CustomHandler
Types ¶
type CustomHandler ¶
type CustomHandler struct {
// contains filtered or unexported fields
}
CustomHandler adds trace_id and user_id from context
func NewCustomHandler ¶
func NewCustomHandler(w io.Writer, opts *slog.HandlerOptions) *CustomHandler
NewCustomHandler creates a new CustomHandler
Click to show internal directories.
Click to hide internal directories.