zerolog

package module
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Overview

Package zerolog provides a middleware that adds a zerolog logger to the context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options ...Option) func(next lambda.Handler) lambda.Handler

New build a new zerolog middleware, this uses zerolog to emit a log message for the input and output events. Stack and Caller enabled.

Types

type Option

type Option func(opts *zerlogOptions)

Option assign settings to the zerolog middlware.

func Fields

func Fields(fields map[string]any) Option

Fields pass a map of attributes which are appended to all log messages emitted by this logger.

func Level added in v1.4.0

func Level(level zerolog.Level) Option

Level minimum accepted level for logging. Defaults to zerolog.InfoLevel.

func Output

func Output(output io.Writer) Option

Output is a writer where logs in JSON format are written. Defaults to os.Stderr.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL