logging

package
v0.0.0-...-9e55594 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(logConfig LoggingConfig)

* * Apply the given configuration to the global logger. *

func GetGinInternalWriter

func GetGinInternalWriter() io.Writer

func GinHandlerFunc

func GinHandlerFunc() gin.HandlerFunc

* * Gin compatible function to enable logger injection into the gin-framework *

func Log

func Log() *zap.SugaredLogger

* * Global access to the singleton logger *

func PrettyPrintObject

func PrettyPrintObject(objectInterface interface{}) string

* * Helper method to print objects with json-serialization information in a more human readable way

Types

type LoggingConfig

type LoggingConfig struct {
	// loglevel to be used - can be DEBUG, INFO, WARN or ERROR
	Level string `mapstructure:"level" default:"INFO"`
	// should the logging in a structured json format
	JsonLogging bool `mapstructure:"jsonLogging" default:"true"`
	// should requests be logged
	LogRequests bool `mapstructure:"logRequests" default:"true"`
	// list of paths to be ignored on request logging(could be often called operational endpoints like f.e. metrics)
	PathsToSkip []string `mapstructure:"pathsToSkip"`
	// stops annotating logs with the calling function's file name and line number
	DisableCaller bool `mapstructure:"disableCaller" default:"false"`
}

logging config

Jump to

Keyboard shortcuts

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