From 3017b245c9275f910dff472ee5e7729625c4f913 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Thu, 28 Apr 2022 10:42:30 -0400 Subject: logging: Use `RedirectStdLog` to capture more stdlib logs (#4732) * logging: Use `RedirectStdLog` * .gitignore a file pattern that I'm constantly using for testing --- logging.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'logging.go') 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 } -- cgit v1.2.3