Documentation ¶
Overview ¶
Package alog кастомизация slog логгера.
Package alog кастомизация slog логгера.
Package alog кастомизация slog логгера.
Package alog кастомизация slog логгера.
Package alog кастомизация slog логгера.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TraceIDKey = "trace-id" SpanIDKey = "span-id" RequestIDKey = "requestId" RequestBodyMaxSize = 64 * 1024 // 64KB ResponseBodyMaxSize = 64 * 1024 // 64KB HiddenRequestHeaders = map[string]struct{}{ "authorization": {}, "cookie": {}, "set-cookie": {}, "x-auth-token": {}, "x-csrf-token": {}, "x-xsrf-token": {}, } HiddenResponseHeaders = map[string]struct{}{ "set-cookie": {}, } // Formatted with http.CanonicalHeaderKey RequestIDHeaderKey = "X-Request-Id" )
Functions ¶
func New ¶
New returns a fiber.Handler (middleware) that logs requests using slog.
Requests with errors are logged using slog.Error(). Requests without errors are logged using slog.Info(). Исправленный. Оригинал: https://github.com/samber/slog-fiber
func NewWithConfig ¶
NewWithConfig returns a fiber.Handler (middleware) that logs requests using slog.
Types ¶
type HandlerJSON ¶
HandlerJSON промышленный JSON логгер.
func NewHandlerJSON ¶
func NewHandlerJSON(out io.Writer, opts *slog.HandlerOptions) *HandlerJSON
type PrettyHandler ¶
PrettyHandler «симпатичный» логгер.
func NewPrettyHandlerText ¶
func NewPrettyHandlerText(out io.Writer, opts PrettyHandlerOptions) *PrettyHandler
type PrettyHandlerOptions ¶
type PrettyHandlerOptions struct {
SlogOpts slog.HandlerOptions
}
Click to show internal directories.
Click to hide internal directories.