From 9658d53a5580e026351c435ba534a7d387c16116 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Tue, 26 Apr 2022 22:47:23 -0400 Subject: [PATCH 1/2] logging: Use `RedirectStdLog` --- logging.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/logging.go b/logging.go index 129aec4301f..5f8ea06a908 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 } From 6d88c853bc11f43a024a6e1597aa09cfbf2df480 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Tue, 26 Apr 2022 23:15:47 -0400 Subject: [PATCH 2/2] .gitignore a file pattern that I'm constantly using for testing --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5322a53f0d8..e154526b3a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ _gitignore/ *.log Caddyfile +Caddyfile.* !caddyfile/ # artifacts from pprof tooling