From c683bab8e7ab0223fe988bf2b9b5861f662adcf3 Mon Sep 17 00:00:00 2001 From: "David J. M. Karlsen" Date: Tue, 20 Sep 2022 13:15:28 +0200 Subject: [PATCH] log structured, use RFC3339 formatting (#489) --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index fd72354f..a3f0acb9 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,7 @@ package main import ( "flag" + "go.uber.org/zap/zapcore" "log" "os" "strings" @@ -61,7 +62,9 @@ func main() { "Enabling this will ensure there is only one active controller manager.") flag.Parse() - ctrl.SetLogger(zap.New(zap.UseDevMode(true))) + ctrl.SetLogger(zap.New(zap.UseDevMode(true), zap.JSONEncoder(func(encoderconfig *zapcore.EncoderConfig) { + encoderconfig.EncodeTime = zapcore.RFC3339TimeEncoder + }))) namespace := os.Getenv("WATCH_NAMESPACE") options := ctrl.Options{