SUSE Support

Here When You Need Us

How to change the log level for Rancher v2.x

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

Environment

SUSE Rancher v2.x

Situation

Task

By default the Rancher v2.x server log level is set to info; however, when investigating an issue it may be helpful to increase the log verbosity to debug. This article details how to control the log verbosity on Rancher v2.x containers.

Pre-requisites

Resolution

The log verbosity is set within a running Rancher server container by use of the loglevel command:

loglevel --set <verbosity>

Using kubectl with your cluster's context, you can update the log level of all your Rancher server containers by running the following:

kubectl -n cattle-system get pods -l app=rancher --no-headers -o custom-columns=name:.metadata.name | while read rancherpod; do kubectl -n cattle-system exec $rancherpod -c rancher -- loglevel --set debug; done

where verbosity is one of error, info or debug.

Instructions on how to run this command in either a single node or High Availability installation of Rancher can be found within the Rancher documentation under the "Logging" troubleshooting guide.

If the log level is increased to debug for troubleshooting purposes, you should be sure to reduce to info after the necessary logs have been captured, in order to reduce disk usage and minimise noise when reading the logs.

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.

  • Document ID:000020239
  • Creation Date: 27-Mar-2024
  • Modified Date:27-Mar-2024
    • SUSE Rancher

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.