From 3bfe3cf2c322bbb1a99069eb5e2821a3599dd34b Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Mon, 29 Mar 2021 18:25:47 -0400 Subject: [PATCH] log/logconfig: change exit-on-error to default to true for stderr This change unearths runtime out-of-memory errors. Before this change, a runtime-detected failure to allocate memory would not make it to the logs. This was tested by injecting a rapid memory leak into the process and determining first that it was not present in logs and then with this change that the stack traces were present in the stderr log. I'm omitting a release note primarily because I do not know how to frame one. Relates to debugging #62320. Release note: None --- pkg/util/log/logconfig/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/util/log/logconfig/config.go b/pkg/util/log/logconfig/config.go index 6fef5711191e..632bd0bd943b 100644 --- a/pkg/util/log/logconfig/config.go +++ b/pkg/util/log/logconfig/config.go @@ -37,7 +37,6 @@ const DefaultFluentFormat = `json-fluent-compact` // DefaultConfig returns a suitable default configuration when logging // is meant to primarily go to files. func DefaultConfig() (c Config) { - // TODO(knz): The default for 'stderr:exit-on-error' should probably be 'false'. const defaultConfig = ` file-defaults: filter: INFO @@ -59,7 +58,7 @@ sinks: format: ` + DefaultStderrFormat + ` redactable: true channels: all - exit-on-error: true + exit-on-error: false capture-stray-errors: enable: true `