Documentation ¶
Index ¶
- Variables
- func Handler(opts *Options) func(next http.Handler) http.Handler
- func LogEntry(ctx context.Context) *zap.Logger
- func LogEntrySetField(ctx context.Context, key, value string)
- func LogEntrySetFields(ctx context.Context, fields ...zapcore.Field)
- func RequestLogger(opts *Options) func(next http.Handler) http.Handler
- type Options
- type RequestLoggerEntry
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{ Logger: zap.Must(zap.NewProduction()), Concise: false, }
Functions ¶
func LogEntrySetField ¶
Types ¶
type Options ¶
type Options struct { Logger *zap.Logger // Concise determines Whether to log the entries in concise mode. Concise bool // SkipURLParams determines which get parameters shouldn't be logged. SkipURLParams []string // SkipHeaders determines which headers shouldn't be logged. SkipHeaders []string // SkipPaths determines which paths shouldn't be logged. SkipPaths []string // ErrorMiddleware is a middleware that will be injected between the logger middleware and the Recoverer middleware. // This allows you to customize the 500 error page in the case of a panic. ErrorMiddleware func(http.Handler) http.Handler }
type RequestLoggerEntry ¶
func (*RequestLoggerEntry) Panic ¶
func (l *RequestLoggerEntry) Panic(v interface{}, stack []byte)
Click to show internal directories.
Click to hide internal directories.