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 GinHandlerFunc ¶
func GinHandlerFunc() gin.HandlerFunc
* * Gin compatible function to enable logger injection into the gin-framework *
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
Click to show internal directories.
Click to hide internal directories.