MCPcopy
hub / github.com/uber-go/zap / NewProductionConfig

Function NewProductionConfig

config.go:157–170  ·  view source on GitHub ↗

NewProductionConfig builds a reasonable default production logging configuration. Logging is enabled at InfoLevel and above, and uses a JSON encoder. Logs are written to standard error. Stacktraces are included on logs of ErrorLevel and above. DPanicLevel logs will not panic, but will write a stackt

()

Source from the content-addressed store, hash-verified

155// See [NewProductionEncoderConfig] for information
156// on the default encoder configuration.
157func NewProductionConfig() Config {
158 return Config{
159 Level: NewAtomicLevelAt(InfoLevel),
160 Development: false,
161 Sampling: &SamplingConfig{
162 Initial: 100,
163 Thereafter: 100,
164 },
165 Encoding: "json",
166 EncoderConfig: NewProductionEncoderConfig(),
167 OutputPaths: []string{"stderr"},
168 ErrorOutputPaths: []string{"stderr"},
169 }
170}
171
172// NewDevelopmentEncoderConfig returns an opinionated EncoderConfig for
173// development environments.

Callers 8

TestConfigFunction · 0.85
withBenchedLoggerFunction · 0.85
BenchmarkAddCallerHookFunction · 0.85
Benchmark100FieldsFunction · 0.85
TestLoggerWriteFailureFunction · 0.85
NewProductionFunction · 0.85

Calls 2

NewAtomicLevelAtFunction · 0.85

Tested by 7

TestConfigFunction · 0.68
withBenchedLoggerFunction · 0.68
BenchmarkAddCallerHookFunction · 0.68
Benchmark100FieldsFunction · 0.68
TestLoggerWriteFailureFunction · 0.68