mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
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
2 changed files with 8 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
|||
_gitignore/
|
||||
*.log
|
||||
Caddyfile
|
||||
Caddyfile.*
|
||||
!caddyfile/
|
||||
|
||||
# artifacts from pprof tooling
|
||||
|
|
|
@ -661,9 +661,15 @@ func newDefaultProductionLog() (*defaultCustomLog, error) {
|
|||
|
||||
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{
|
||||
CustomLog: cl,
|
||||
logger: zap.New(cl.core),
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue