Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
End the formatter and logger confusion and have the formatter output log messages #9126
For Chef-16 we should have the formatter output logger warnings through events and turn off the logger by default, and have logger-vs-formatter be an either-or setting and stop allowing the formatter and logger to run at the same time.
Several closed issues referenced below are still relevant and are rolled up under solving this issue.
The default behavior should be to use the formatter. If a user sends the output to a -L logfile then the formatter output should go to the log file and not the output to stdout.
We may need to deprecate the setting of log_location in the config.rb as something that nobody should be doing (so that log_location is not forced to the /var/log output file for command line usage, and that the -L option should be used from systemd/cron/whatever instead by daemon processes). As a stretch goal we might still support cloning the output to STDOUT when on a tty if the logic can be made simple enough to not be the buggy mess that we've had to deal with. I don't mind that as a use case, but its implementation has been a disaster.
Using --force-logger should turn off the formatter and turn on the logger and that should just be what you get. If there's any STDOUT cloning then either the formatter goes to both places or the logger goes to both places, and we don't ever cross the streams. The ability have pretty formatter output to users and logger output to syslog is going to go away permanently. For those affected users, they should really setup better systems involving the data collector to gather and parse output.