-
Task
-
Resolution: Unresolved
-
Minor
-
None
-
Logging 5.9.0
-
5
-
False
-
None
-
False
-
NEW
-
NEW
-
Release Note Not Required
-
-
-
Log Collection - Sprint 252
Summary
Refactor the log library implementation to unify the log functionality
to reduce extraneous log messages
Acceptance Criteria
- Verify log message output is controlled by a single log level/verbosity configuration
- Verify logging output is formatted as a JSON string
- Verify logs set for a high verbosity (e.g. trace?) are masked when the component level is lower then the verbosity
- Verify logs set for a low verbosity (e.g. trace?) are visible when the component level is higher then the verbosity
Notes
Following the fix for https://issues.redhat.com/browse/LOG-5136
The CLO now produces a series of runtime "info" logs generated for every watched resource. Additionally, there are several "Reconciler errors" produced for various reasons, as well as a Warning about the CLF reconciler.
Additional Notes:
we are using the term LOG_LEVEL as an env var, which sets the verbosity level. We should also be able to set a log level (priority) of logs. We have these two conflated. Our current static log package does not have a method for setting the priority level per the interface.
Steps to Reproduce:
1. install CLO
2. Run:
$ oc logs -lname=cluster-logging-operator
{"_ts":"2024-03-05T17:15:27.237502433Z","_level":"0","_component":"cluster-logging-operator","_message":"starting up...","go_arch":"amd64","go_os":"linux","go_version":"go1.20.10","operator_version":"5.9.0"} {"_ts":"2024-03-05T17:15:27.277528297Z","_level":"0","_component":"cluster-logging-operator","_message":"migrating resources provided by the manifest"} {"_ts":"2024-03-05T17:15:27.283576523Z","_level":"0","_component":"cluster-logging-operator","_message":"Registering Components."} {"_ts":"2024-03-05T17:15:27.298149472Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting the Cmd."} {"_ts":"2024-03-05T17:15:27.298329909Z","_level":"0","_component":"cluster-logging-operator_controller-runtime_metrics","_message":"Starting metrics server"} {"_ts":"2024-03-05T17:15:27.298641427Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogging","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogging","source":"kind source: *v1.ClusterLogging"} {"_ts":"2024-03-05T17:15:27.29869987Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogging","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogging","source":"kind source: *v1.Service"} {"_ts":"2024-03-05T17:15:27.298707121Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogforwarder","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogForwarder","source":"kind source: *v1.ClusterLogForwarder"} {"_ts":"2024-03-05T17:15:27.298771173Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogging","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogging","source":"kind source: *v1.Secret"} {"_ts":"2024-03-05T17:15:27.298805321Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogging","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogging","source":"kind source: *v1.ConfigMap"} {"_ts":"2024-03-05T17:15:27.298842248Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogging","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogging","source":"kind source: *v1.Role"} {"_ts":"2024-03-05T17:15:27.298777633Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogforwarder","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogForwarder","source":"kind source: *v1.ConfigMap"} {"_ts":"2024-03-05T17:15:27.298826794Z","_level":"0","_component":"cluster-logging-operator_controller-runtime_metrics","_message":"Serving metrics server","bindAddress":":8686","secure":false} {"_ts":"2024-03-05T17:15:27.298897187Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogforwarder","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogForwarder","source":"kind source: *v1.DaemonSet"} {"_ts":"2024-03-05T17:15:27.298905424Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting EventSource","controller":"clusterlogging","controllerGroup":"logging.openshift.io","controllerKind":"ClusterLogging","source":"kind source: *v1.RoleBinding"} .... .... {"_ts":"2024-03-05T17:16:35.89568174Z","_level":"0","_component":"cluster-logging-operator","_message":"Error reconciling clusterlogging instance","_error": {"msg":"unable to create or update collection for \"instance\": waiting for openshift-logging/collector-trusted-ca-bundle ConfigMap to get created"}} {"_ts":"2024-03-05T17:16:35.910624057Z","_level":"0","_component":"cluster-logging-operator","_message":"Warning: Reconciler returned both a non-zero result and a non-nil error. The result will always be ignored if the error is non-nil and the non-nil error causes reqeueuing with exponential backoff. For more details, see: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile#Reconciler", "ClusterLogForwarder": {"name":"instance","namespace":"openshift-logging"}, "controller":"clusterlogforwarder","controllerGroup": "logging.openshift.io","controllerKind": "ClusterLogForwarder","name":"instance","namespace":"openshift-logging","reconcileID":"68ecbd2d-e15b-47f0-948d-1e29e309937a"} {"_ts":"2024-03-05T17:16:35.910660614Z","_level":"0","_component":"cluster-logging-operator","_message":"Reconciler error","ClusterLogForwarder":{"name":"instance","namespace":"openshift-logging"},"_error":{"msg":"unable to create or update collection for \"instance\": services \"collector\" already exists"}, "controller":"clusterlogforwarder","controllerGroup": "logging.openshift.io","controllerKind":"ClusterLogForwarder","name":"instance","namespace":"openshift-logging","reconcileID":"68ecbd2d-e15b-47f0-948d-1e29e309937a"} {"_ts":"2024-03-05T17:16:35.928163384Z","_level":"0","_component":"cluster-logging-operator","_message":"Reconciler error","ClusterLogging":{"name":"instance","namespace":"openshift-logging"},"_error":{"msg":"unable to create or update collection for \"instance\": waiting for openshift-logging/collector-trusted-ca-bundle ConfigMap to get created"}, "controller":"clusterlogging","controllerGroup":"logging.openshift.io", "controllerKind":"ClusterLogging","name":"instance", "namespace":"openshift-logging","reconcileID":"7598d702-7058-4f5b-9cb5-611bac0e78b9"}