[Question] Change operator log level
Describe the issue
Is there any option to configure the operator log level?
For example, to reduce this kind of logs
1.6768157667830777e+09 INFO controllers.FluentBitConfig Fluent Bit main configuration has updated {"logging-control-plane": "fluent", "fluentbitconfig": "fluentbit-config", "secret": "fluentbit-config"}
How did you install fluent operator?
Helm chart
Additional context
No response
1.6768157667830777e+09 INFO controllers.FluentBitConfig Fluent Bit main configuration has updated {"logging-control-plane": "fluent", "fluentbitconfig": "fluentbit-config", "secret": "fluentbit-config"}
Configuration changes are important information that doesn't occur a lot, so setting it to info level is ok https://github.com/fluent/fluent-operator/blob/master/controllers/fluentdconfig_controller.go#L218
Hi,
I don't mean change the notification from INFO to other logging level, I mean to don't print "INFO" logs to console. That is changing the global log-level that is output to console
Kind regards, Sergio
Hi,
I don't mean change the notification from INFO to other logging level, I mean to don't print "INFO" logs to console. That is changing the global log-level that is output to console
Kind regards, Sergio
Sorry, I don't get it. K8s applications always output logs to stdout and logging agent usually collect k8s app logs from stdout.
@wanjunlei
Hi,
I don't mean to don't print to console. Let me try to recap how log usually works.
- You have a "logging" service that writes to console (or other outputs)
- You write lines of logs with certain level
- log.info / log.Error / log.Warn (and so on)
- There is global log level setting
- if the global log level is greater that the log-level of the message the the message is print if no, it isn't
For example
r.Log.Info("Fluentd main configuration has updated", "logging-control-plane", fd.Namespace, "fd", fd.Name, "secret", secName)
If the global log level is "INFO / DEBUG" the message is printed to console if the global log level is "WARM / ERROR" the message isn't printed to console
Hi,
I don't mean to don't print to console. Let me try to recap how log usually works.
You have a "logging" service that writes to console (or other outputs)
You write lines of logs with certain level
- log.info / log.Error / log.Warn (and so on)
There is global log level setting
- if the global log level is greater that the log-level of the message the the message is print if no, it isn't
For example
r.Log.Info("Fluentd main configuration has updated", "logging-control-plane", fd.Namespace, "fd", fd.Name, "secret", secName)If the global log level is "INFO / DEBUG" the message is printed to console if the global log level is "WARM / ERROR" the message isn't printed to console
Use --zap-log-level to set the log level.
If the global log level is "INFO / DEBUG" the message is printed to console if the global log level is "WARM / ERROR" the message isn't printed to console
Got you, I think @wanjunlei answered your question
Hi, Yes and no. I know that a setting exists, but would like how to set the setting in the chart
thanks in advance
It is currently impossible to set it in the helm chart.
Tested manually with the following code and it works
containers:
- name: fluent-operator
image: kubesphere/fluent-operator:v2.0.0
args:
- "--zap-log-level=error"
Would be good to have a feature to set custom args (also custom environment variables) to the operator.
Thank you very much for your work