Skip to content

How to configure rancher-logging to send to a file

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

Environment

Rancher 2.9.x+

Logging Operator V2

Situation

The rancher-logging operator includes an option to send logs to a file. While this approach is not ideal for production environments where logs should be shipped to a centralized location for storage and further processing. It can be a valuable tool for testing purposes to ensure that the operator is properly configured.

Resolution

Below is a simple way to configure logs to be sent to a file on the node. An output YAML would look like this:

apiVersion: logging.banzaicloud.io/v1beta1
kind: Output
metadata:
  name: fileoutput
  namespace: default
spec:
  file:
    path: /tmp/${tag}

Note the ${tag} on the path, required by Fluentd.

In this case, the logs will be available on the /tmp folder of the Pod rancher-logging-root-fluentd-0

If logs are not written to the /tmp folder, open a case with us to help you.

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.