Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultStructuredLoggerOptions = &StructuredLoggerOptions{ SkipPaths: []string{}, LogLevel: slog.LevelDebug, TimeFieldFormat: time.RFC3339, TimeFieldName: "timestamp", }
Functions ¶
func NewStructuredLogger ¶
Types ¶
type ServerLogger ¶
type ServerLogger struct{}
type StructuredLogger ¶
type StructuredLogger struct {
Logger slog.Handler
Options *StructuredLoggerOptions
}
func (*StructuredLogger) NewLogEntry ¶
func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry
type StructuredLoggerEntry ¶
type StructuredLoggerEntry struct {
// contains filtered or unexported fields
}
func (*StructuredLoggerEntry) Panic ¶
func (e *StructuredLoggerEntry) Panic(v interface{}, stack []byte)
type StructuredLoggerOptions ¶
type StructuredLoggerOptions struct {
// LogLevel defines the minimum level of severity that app should log.
LogLevel slog.Level
// SkipPaths defines a list of paths that should not be logged.
SkipPaths []string
// TimeFieldFormat defines the time format of the Time field, defaulting to "time.RFC3339Nano" see options at:
// https://pkg.go.dev/time#pkg-constants
TimeFieldFormat string
// TimeFieldName sets the field name for the time field.
// Some providers parse and search for different field names.
TimeFieldName string
}
Click to show internal directories.
Click to hide internal directories.