Changing Log Levels


#1

The default log level in Replicated is info. Available log levels are error, warn, info and debug. To change the log level in Replicated you will need to edit Replicated’s config files and then restart. Replicated’s services are configured via the files /etc/default/replicated and /etc/default/replicated-operator or /etc/sysconfig/replicated and /etc/sysconfig/replicated-operator depending on your distribution. You will then need to modify the REPLICATED_OPTS and REPLICATED_OPERATOR_OPTS entries respectively so that LOG_LEVEL is set appropriately. Once you have made the changes and saved the files, you must then restart Replicated for your changes to take effect. You can find instructions on restarting Replicated here.

Below is an example /etc/default/replicated configuration file with Replicated’s log level set to debug:

RELEASE_CHANNEL=stable
PRIVATE_ADDRESS=10.128.0.8
SKIP_OPERATOR_INSTALL=0
REPLICATED_OPTS=" -e DAEMON_TOKEN=<Ae..> -e LOG_LEVEL=debug -e NODENAME=testing.replicated.internal"
REPLICATED_UI_OPTS=""

#2

For Swarm, you can run docker service update --env-add LOG_LEVEL=debug


#3

Below is documentation for how to change log levels in Kubernetes:

Changing Log Levels in a Kubernetes deployment

  • Run kubectl edit deployments replicated. This should open a Vi/Nano editor with the deployment YAML.
  • Search for the LOG_LEVEL environment variable.
    • There should be occurences for the replicated and replicated-ui containers under the env key.
  • Change the environment variable to your preferred log level.
    • Log levels: error, warn, info, debug
  • Save/close the editor. This will trigger a redeployment of the replicated pod with the log level set.