On some machines running CentOS 7.6 I discovered that chef-client (configured with systemd service) is logging its full output to journald. By "full" I mean that it is the same kind of output that you would see by running chef-client in interactive terminal. It's format is different than what is being saved to file configured in
log_location, but I believe that it shouldn't log every run with level
:info to journald when it is configured to log to a file.
Here is an example result of running journalctl -u chef-client:
[xxx@machine1 ]# journalctl -u chef-client -- Logs begin at wto 2019-07-16 10:40:01 CEST, end at śro 2019-07-17 12:22:32 CEST. -- lip 16 16:35:35 hostname.com chef-client: Starting Chef Client, version 14.5.33 lip 16 16:35:41 hostname.com chef-client: resolving cookbooks for run list: ["example:test1", "example::test2"] lip 16 16:35:41 hostname.com chef-client: Synchronizing Cookbooks: [...]
and on the other machine:
[xxx@machine2 ]# journalctl -u chef-client -- No entries --
chef_server_url 'https://example.com/organizations/example' validation_client_name 'validator' log_location '/var/log/file.log' log_level :info
I don't know what it depends on but on some servers it does not log to journald (except informations about being restarted, reloaded, etc). All of the servers are CentOS 7.6 with the same version of chef-client (14.5.33) and the same config file.
Any ideas what might cause it?