diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-10-29 11:58:29 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-10-29 11:58:29 -0600 |
commit | c4c45f8e01bd59b556eaa84f4d6c6ec529e01acb (patch) | |
tree | c5b51f3ca78a947b51b040641fed906d180a5682 | |
parent | 54e458b756cf2cdb8adb750e822ead8e3a973441 (diff) |
logging: Tweak defaults (enable logging by default, color level enc.)
-rw-r--r-- | caddy.go | 11 | ||||
-rw-r--r-- | logging.go | 1 |
2 files changed, 7 insertions, 5 deletions
@@ -119,11 +119,12 @@ func run(newCfg *Config, start bool) error { newCfg.cancelFunc = cancel // clean up later // set up logging before anything bad happens - if newCfg.Logging != nil { - err := newCfg.Logging.openLogs(ctx) - if err != nil { - return err - } + if newCfg.Logging == nil { + newCfg.Logging = new(Logging) + } + err = newCfg.Logging.openLogs(ctx) + if err != nil { + return err } // set up global storage and make it CertMagic's default storage, too @@ -577,6 +577,7 @@ func newDefaultProductionLog() (*defaultCustomLog, error) { return nil, err } encCfg := zap.NewProductionEncoderConfig() + encCfg.EncodeLevel = zapcore.CapitalColorLevelEncoder cl.encoder = zapcore.NewConsoleEncoder(encCfg) cl.levelEnabler = zapcore.InfoLevel |