summaryrefslogtreecommitdiff
path: root/logging.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-04-28 10:42:30 -0400
committerGitHub <noreply@github.com>2022-04-28 08:42:30 -0600
commit3017b245c9275f910dff472ee5e7729625c4f913 (patch)
treeb73ba1566c960e2549baa52937cf120737f3a7bc /logging.go
parent2e4c09155a750895a306f8900a6d5f4597db5287 (diff)
logging: Use `RedirectStdLog` to capture more stdlib logs (#4732)
* logging: Use `RedirectStdLog` * .gitignore a file pattern that I'm constantly using for testing
Diffstat (limited to 'logging.go')
-rw-r--r--logging.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/logging.go b/logging.go
index 129aec4..5f8ea06 100644
--- a/logging.go
+++ b/logging.go
@@ -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
}