Log Management
Chef Automate uses systemd
. Log management is performed according to the configuration defined for the system service journald
.
Viewing Logs
To view the logs you can run:
journalctl -u chef-automate
To follow the logs in realtime:
journalctl -u chef-automate -f
For information on changing the output, please refer to the man page or run:
journalctl --help
Configuring Log Level
You can configure Chef Automate log level for all services by creating a TOML file and configuring the log level. By default each service will initialize at the “info” level but can be any of ‘debug, ‘info’, ‘warning’, ‘panic’, or ‘fatal’.
[global.v1.log]
level = "debug"
Then run chef-automate config patch </path/to/your-file.toml>
to deploy your change.
Configuring Log Rotation and Retention
Log rotation and retention settings are managed at a system level using journald
. At this point, journald
does not support log retention policies at a granular level for units within itself. See the man page for more configuration options in /etc/systemd/journald.conf
.
Configuring Rate Limiter
The rate limiter is used to control the volume of log messages that are written to the journal. You can configure Rate Limiter by creating a TOML file.
[global.v1.log]
rate_limit_interval = 30
rate_limit_burst = 10000
Then run chef-automate config patch </path/to/your-file.toml>
to deploy your change.
Set the following values:
rate_limit_interval
: This defines the time interval for rate-limiting in seconds. For example, if it’s set to 30s, journald will track messages within each 30-seconds window. Default value will be same as thejournald
default value, which is30
Journal Page.rate_limit_burst
: This sets the maximum number of messages allowed within the interval defined by rate_limit_interval. If more messages are received within the interval, they will be temporarily suppressed to avoid spamming the journal. Default value will be same as thejournald
default value, which is10000
Journal Page.
Warning