mirror of https://github.com/caddyserver/caddy.git
logging: Use `RedirectStdLog` to capture more stdlib logs (#4732)
* logging: Use `RedirectStdLog` * .gitignore a file pattern that I'm constantly using for testing
This commit is contained in:
parent
2e4c09155a
commit
3017b245c9
|
@ -1,6 +1,7 @@
|
||||||
_gitignore/
|
_gitignore/
|
||||||
*.log
|
*.log
|
||||||
Caddyfile
|
Caddyfile
|
||||||
|
Caddyfile.*
|
||||||
!caddyfile/
|
!caddyfile/
|
||||||
|
|
||||||
# artifacts from pprof tooling
|
# artifacts from pprof tooling
|
||||||
|
|
|
@ -661,9 +661,15 @@ func newDefaultProductionLog() (*defaultCustomLog, error) {
|
||||||
|
|
||||||
cl.buildCore()
|
cl.buildCore()
|
||||||
|
|
||||||
|
logger := zap.New(cl.core)
|
||||||
|
|
||||||
|
// capture logs from other libraries which
|
||||||
|
// may not be using zap logging directly
|
||||||
|
_ = zap.RedirectStdLog(logger)
|
||||||
|
|
||||||
return &defaultCustomLog{
|
return &defaultCustomLog{
|
||||||
CustomLog: cl,
|
CustomLog: cl,
|
||||||
logger: zap.New(cl.core),
|
logger: logger,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue