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
()
| 155 | // See [NewProductionEncoderConfig] for information |
| 156 | // on the default encoder configuration. |
| 157 | func 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. |