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: 12 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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