From e124c556a9509e699ec0084a86d8ea17eef2340e Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Fri, 3 Nov 2023 15:50:54 -0600 Subject: [PATCH] Send tink-worker logs to stdout instead of stderr: In HookOS, normally, all Docker logs are sent via syslog to Smee. When a container writes its logs to stderr the Docker syslog driver will set the severity to "ERR". This then shows up in Smee's logs. User are consistently confused as to what this severity means and more often than not, they believe the log line to be an error. By writing tink-worker logs to stdout the severity in syslog will be "INFO". Signed-off-by: Jacob Weinstock --- cmd/tink-worker/cmd/root.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/tink-worker/cmd/root.go b/cmd/tink-worker/cmd/root.go index f8c1a0b06..a7dfbe4e1 100644 --- a/cmd/tink-worker/cmd/root.go +++ b/cmd/tink-worker/cmd/root.go @@ -27,7 +27,9 @@ const ( // NewRootCommand creates a new Tink Worker Cobra root command. func NewRootCommand(version string) *cobra.Command { - zlog, err := zap.NewProduction() + config := zap.NewProductionConfig() + config.OutputPaths = []string{"stdout"} + zlog, err := config.Build() if err != nil { panic(err) }