Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLogger ¶
func New ¶
func New(options ...HandlerWrapOption) *slog.Logger
New is wrapped constructor of log.slog
Types ¶
type BlogAPILogHandler ¶
type BlogAPILogHandler struct {
// contains filtered or unexported fields
}
BlogAPILogHandler is an implementation of slog.Handler for blogapi.
func NewBlogAPILogHandler ¶
func NewBlogAPILogHandler(w io.Writer, handlerOption *slog.HandlerOptions) *BlogAPILogHandler
NewBlogAPILogHandler is constructor of BlogAPILogHandler.
func (*BlogAPILogHandler) Handle ¶
Handle add trace id to slog.Attrs from context before output. See: https://pkg.go.dev/log/slog#JSONHandler.Handle
type HandlerWrapOption ¶
HandlerWrapOption is an option for slog.Handler.
func WithAltNRSlogTransactionalHandler ¶
func WithAltNRSlogTransactionalHandler(app *newrelic.Application, nrtx *newrelic.Transaction) HandlerWrapOption
WithAltNRSlogTransactionalHandler returns a slog.Handler wrapped altnrslog,TransactionalHandler.
func WithInnerHandler ¶
func WithInnerHandler(innerHandler slog.Handler) HandlerWrapOption
func WithWriter ¶
func WithWriter(w io.Writer) HandlerWrapOption
WithWriter returns a slog.Handler with a modified log.writer if the handler type is BlogAPILogHandle otherwise unmodified slog.Handler.
Click to show internal directories.
Click to hide internal directories.