Skip to content

How to enable fluent-bit debug logging

This document (000020909) is provided subject to the disclaimer at the end of this document.

Environment

Rancher with Rancher-Logging chart v2

Situation

When troubleshooting the fluent-bit log level might need to be increased to debug level.

Resolution

Fluent-bit debug level logging can be changed by modifying the logLevel spec of the logging CRD

The following steps will help enable or disable debug-level logging for fluent-bit:

1. Edit rancher logging CRD

> kubectl edit logging rancher-logging-root

2. Add logLevel debug to the fluentbit spec

spec:
  controlNamespace: cattle-logging-system
  fluentbit:
    image:
      repository: rancher/mirrored-fluent-fluent-bit
      tag: 1.9.3
    logLevel: debug

3. Confirm log level is set to debug

> kubectl get pods -n cattle-logging-system -l app.kubernetes.io/name=fluentbit
NAME                                  READY   STATUS    RESTARTS   AGE
rancher-logging-root-fluentbit-gqq8l  1/1     Running   0          19s

> kubectl logs --tail=10 -n cattle-logging-system rancher-logging-root-fluentbit-gqq8l
[2023/01/13 09:44:18] [debug] [input chunk] update output instances with new chunk size diff=1841
[2023/01/13 09:44:18] [debug] [input:tail:tail.0] inode=2594165 events: IN_MODIFY
[2023/01/13 09:44:18] [debug] [input chunk] update output instances with new chunk size diff=927
[2023/01/13 09:44:18] [debug] [input:tail:tail.0] inode=2594165 events: IN_MODIFY
[2023/01/13 09:44:18] [debug] [input chunk] update output instances with new chunk size diff=1840
[2023/01/13 09:44:18] [debug] [input chunk] update output instances with new chunk size diff=1840
[2023/01/13 09:44:18] [debug] [input:tail:tail.0] inode=2594165 events: IN_MODIFY
[2023/01/13 09:44:18] [debug] [input chunk] update output instances with new chunk size diff=927
[2023/01/13 09:44:18] [debug] [input:tail:tail.0] inode=2594165 events: IN_MODIFY
[2023/01/13 09:44:18] [debug] [input chunk] update output instances with new chunk size diff=913

Notes:

  • To reset the logging level to the default info, re-run the same steps and change the logLevel to info.
  • The logLevel value is not exposed via the rancher-logging chart and cannot be configured persistently. As a result, the change will be overwritten and logLevel reset to the default of info after a rancher-logging chart upgrade.

Reference:

  • https://banzaicloud.com/docs/one-eye/logging-operator/configuration/crds/v1beta1/fluentbit_types/#fluentbitspec-loglevel

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.