Set Log Levels

Introduction

Log levels can be set for three different components of EVE-OS: EVE-OS microservices, syslog, and kernel. The log levels set this way are used to control the verbosity of the logs produced by the corresponding components. All logs produced this way will be saved locally in the /persist/newlog/keepSentQueue/ directory and will be subject to rotation based on the max total size of stored logs.

You might want to change your log levels for a variety of reasons. For example, if you have low bandwidth, you might disable info messages and only enable more serious levels of logging.  

Prerequisites

Logrus and Syslog Levels

There are two different sets of log levels that can be set:

Additionally all log levels can be set to "none" to disable logging for the corresponding component or to "all" to enable all log levels.

Remote Log Levels

The "remote" log levels control which subset of the generated logs are sent to the controller. A corresponding "remote" log level can be set for each of the three components: EVE microservices, syslog, and kernel.

Name Type Default Description
debug.default.loglevel string debug Default level of logs produced by EVE microservices. Can be overwritten by agent.agentname.debug.loglevel. Uses logrus log levels as described here ["https://pkg.go.dev/github.com/sirupsen/logrus"]: panic, fatal, error, warning, info, debug and trace.
debug.default.remote.loglevel string warning Default level of logs sent by EVE microservices to the controller. Can be overwritten by agent.agentname.debug.remote.loglevel. Uses logrus log levels as described here ["https://pkg.go.dev/github.com/sirupsen/logrus"]: panic, fatal, error, warning, info, debug and trace.
debug.syslog.loglevel string info Level of the produced syslog messages. System default loglevel string representation should be used as described here ["https://man7.org/linux/man-pages/man3/syslog.3.html"]: emerg, alert, crit, err, warning, notice, info, debug.
debug.syslog.remote.loglevel string info Level of the syslog messages sent to the controller. System default loglevel string representation should be used as described here ["https://man7.org/linux/man-pages/man3/syslog.3.html"]: emerg, alert, crit, err, warning, notice, info, debug.
debug.kernel.loglevel string info Level of the produced kernel log messages. System default loglevel string representation should be used as described here ["https://man7.org/linux/man-pages/man3/syslog.3.html"]: emerg, alert, crit, err, warning, notice, info, debug.
debug.kernel.remote.loglevel string info Level of the kernel log messages sent to the controller. System default loglevel string representation should be used as described here ["https://man7.org/linux/man-pages/man3/syslog.3.html"]: emerg, alert, crit, err, warning, notice, info, debug.

Per-Agent Log Levels

In addition, there can be per-agent settings to overwrite the default log level set for EVE microservices. These use the same log levels as the default log level settings (logrus). The per-agent settings begin with "agent.agentname.setting":

Name Type Description
agent.agentname.debug.loglevel string If set, overrides debug.default.loglevel for this particular agent
agent.agentname.debug.remote.loglevel string If set, overrides debug.default.remote.loglevel for this particular agent


The following agents support per-agent log level settings with "agent.agentname.setting":

  • newlogd
  • wwan
  • nodeagent
  • downloader
  • tpmmgr
  • client
  • vcomlink
  • executor
  • vaultmgr
  • baseosmgr
  • zedagent
  • verifier
  • wstunnelclient
  • zfsmanager
  • zedkube
  • ledmanager
  • faultinjection
  • zedmanager
  • nim
  • loguploader
  • watcher
  • volumemgr
  • zedrouter
  • msrv
  • domainmgr
  • diag

In case of updates: https://github.com/lf-edge/eve/blob/master/docs/CONFIG-PROPERTIES.md#log-levels

Use the ZCLI to Set the Log Level

You can set edge node log configurations through ZCLI (such as loglevel, debug.enable.ssh, interval, and more) at both the project and edge node levels. If you set a log configuration at the project level, all devices onboarded under that project will inherit the project's configurations. If you set log configurations at both the project and edge node levels, the device will inherit the project level settings as well as the specific configurations set at the device level. The edge node level settings take precedence over project level settings. If you set a parameter at the project level, then the edge node level, and then the project level again - the edge node level will still take precedence.

To set the log level for an edge node or for a project, use the update command with the --config option. Enter the “key” for the type of log and the “value” for the log level. See the following examples for the syntax. 

Single edge node

zcli edge-node update <name> [--config=<key:value>...]
Example
zcli edge-node update MY-NODE --config="debug.default.loglevel:error"

Project

zcli project update <name> [--config=<key:value>...]
Example
zcli project update MY-PROJECT --config="debug.default.loglevel:error"

Next Steps

Was this article helpful?
0 out of 0 found this helpful