Documentation ¶
Index ¶
Constants ¶
View Source
const ( GCPAlertLevel severityGCP = "ALERT" GCPCriticalLevel severityGCP = "CRITICAL" GCPErrorLevel severityGCP = "ERROR" GCPWarningLevel severityGCP = "WARNING" GCPInfoLevel severityGCP = "INFO" GCPDebugLevel severityGCP = "DEBUG" GCPFieldKeySeverity = "severity" GCPFieldKeyMsg = "message" GCPFieldKeyTime = "time" )
Variables ¶
This section is empty.
Functions ¶
func GinLogger ¶ added in v1.5.0
func GinLogger(server string) gin.HandlerFunc
GinLogger returns a new Gin middleware that performs logging for our JSON APIs using zerolog rather than the default Gin logger which is a standard HTTP logger. Provide the server name (e.g. adminAPI or BFF) to help us parse the logs. NOTE: we previously used github.com/dn365/gin-zerolog but wanted more customization.
func ResetLogger ¶ added in v1.4.0
func ResetLogger()
Types ¶
type LevelDecoder ¶
LogLevelDecoder deserializes the log level from a config string.
func (*LevelDecoder) Decode ¶
func (ll *LevelDecoder) Decode(value string) error
Decode implements envconfig.Decoder
type SeverityHook ¶
type SeverityHook struct{}
SeverityHook adds GCP severity levels to zerolog output log messages.
Click to show internal directories.
Click to hide internal directories.