From 692e987ee0c4ceae41d0c250facbf0af09649b9a Mon Sep 17 00:00:00 2001 From: Peter Wilcsinszky Date: Thu, 14 Mar 2024 15:23:06 +0100 Subject: [PATCH] chore: hide flow config in the logs by default Signed-off-by: Peter Wilcsinszky --- controllers/logging/logging_controller.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/logging/logging_controller.go b/controllers/logging/logging_controller.go index 7ded214cb..859638f99 100644 --- a/controllers/logging/logging_controller.go +++ b/controllers/logging/logging_controller.go @@ -192,7 +192,9 @@ func (r *LoggingReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct return &reconcile.Result{}, err }) } else { - log.V(1).Info("flow configuration", "config", fluentdConfig) + if os.Getenv("SHOW_FLOW_CONFIG") != "" { + log.Info("flow configuration", "config", fluentdConfig) + } reconcilers = append(reconcilers, fluentd.New(r.Client, r.Log, &logging, fluentdSpec, fluentdExternal, &fluentdConfig, secretList, reconcilerOpts).Reconcile) } @@ -208,7 +210,9 @@ func (r *LoggingReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct return &reconcile.Result{}, err }) } else { - log.V(1).Info("flow configuration", "config", syslogNGConfig) + if os.Getenv("SHOW_FLOW_CONFIG") != "" { + log.Info("flow configuration", "config", syslogNGConfig) + } reconcilers = append(reconcilers, syslogng.New(r.Client, r.Log, &logging, syslogNGSpec, syslogNGExternal, syslogNGConfig, secretList, reconcilerOpts).Reconcile) }