From 55bac14fee7f05b3aacca45c954ea9cca3d1d00f Mon Sep 17 00:00:00 2001 From: Chetan Banavikalmutt Date: Tue, 2 Apr 2024 22:17:25 +0530 Subject: [PATCH] fix: set formatter for klog logger (#3493) Signed-off-by: Chetan Banavikalmutt --- cmd/rollouts-controller/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/rollouts-controller/main.go b/cmd/rollouts-controller/main.go index 4b058b09a7..c8deab3ea0 100644 --- a/cmd/rollouts-controller/main.go +++ b/cmd/rollouts-controller/main.go @@ -89,11 +89,13 @@ func newCommand() *cobra.Command { fmt.Println(version.GetVersion()) return nil } + logger := log.New() setLogLevel(logLevel) if logFormat != "" { log.SetFormatter(createFormatter(logFormat)) + logger.SetFormatter(createFormatter(logFormat)) } - logutil.SetKLogLogger(log.New()) + logutil.SetKLogLogger(logger) logutil.SetKLogLevel(klogLevel) log.WithField("version", version.GetVersion()).Info("Argo Rollouts starting")