Documentation
¶
Overview ¶
Package logging provides a custom slog handler that integrates with the Event Log system. It forwards logs at WARN level and above to the database-backed Event Log for auditing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventLogHandler ¶
type EventLogHandler struct {
// contains filtered or unexported fields
}
EventLogHandler is a slog.Handler that wraps another handler and also writes WARN and ERROR level logs to the Event Log database.
func NewEventLogHandler ¶
func NewEventLogHandler(inner slog.Handler, db *sql.DB) *EventLogHandler
NewEventLogHandler creates a new EventLogHandler that wraps the given handler. Logs at WARN level and above will be written to both the wrapped handler and the Event Log.
func NewEventLogHandlerWithLevel ¶
NewEventLogHandlerWithLevel creates a new EventLogHandler with a custom minimum level.
Click to show internal directories.
Click to hide internal directories.