gin

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetZerologLogger

func SetZerologLogger(loggerFns ...SetZerologLoggerFn) gin.HandlerFunc

SetZerologLogger attaches the zerolog logger returned from each loggerFns function to a shallow copy of the gin request context The logger can then be accessed in a controller method by calling zerolog.Ctx(ctx)

func ZerologLoggerWithRequestId

func ZerologLoggerWithRequestId(ctx context.Context) zerolog.Logger

ZerologLoggerWithRequestId returns a zerolog logger with a request_id field with a new GUID

func ZerologRequestLogger

func ZerologRequestLogger() gin.HandlerFunc

ZerologRequestLogger logs request and response using the zerolog logger from the request context

Types

type SetZerologLoggerFn

type SetZerologLoggerFn func(context.Context) zerolog.Logger

Jump to

Keyboard shortcuts

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