Documentation ¶
Overview ¶
Package zapup (from: zap up) contains code to initialize a zap(https://github.com/uber-go/zap/) logger.
Index ¶
Constants ¶
View Source
const ( // KeyLogLevel sets log level. Valid values: "info", "debug", "warn", "error", "dpanic", "panic", "fatal". KeyLogLevel string = "ZAP_LEVEL" // KeyLogEncoding sets log output encoding. Valid values: "console", "json". KeyLogEncoding string = "ZAP_ENCODING" // KeyFieldCustomer sets meta information for field "customer" to use within log analytics. KeyFieldCustomer string = "ZAP_CUSTOMER" // KeyFieldApp sets meta information for a field "app" to use within log analytics. Defaults to empty string. KeyFieldApp string = "ZAP_APP" // KeyFieldStage sets meta information for a field "stage" to use within log analytics. Defaults to empty string. KeyFieldStage string = "ZAP_STAGE" // KeyOutput sets the output path for zap. Valid values: "stdout", "stderr", "<file path>". Defaults to empty string. KeyOutput string = "ZAP_OUT" )
Variables ¶
This section is empty.
Functions ¶
func MustRootLogger ¶
MustRootLogger returns the inited logger or panics.
func RequestLogger ¶
RequestLogger returns the request logger from the request.
func Reset ¶
func Reset()
Reset resets the Root Logger to enable creating it again on changed environment.
func RootLogger ¶
RootLogger initiates and returns the root logger considering environment variables: ZAP_LEVEL, ZAP_ENCODING, ZAP_CUSTOMER, ZAP_APP, ZAP_OUT. init() is explicitly NOT(!) used to avoid issues with writing logs by other init() functions and init races.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.