chef

https://github.com/opscode/chef

Ruby

A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.

Chef::Application#configure_logging

Initialize and configure the logger.
=== Loggers and Formatters
In Chef 10.x and previous, the Logger was the primary/only way that Chef
communicated information to the user. In Chef 10.14, a new system, "output
formatters" was added, and in Chef 11.0+ it is the default when running
chef in a console (detected by `STDOUT.tty?`). Because output formatters
are more complex than the logger system and users have less experience with
them, the config option `force_logger` is provided to restore the Chef 10.x
behavior.

Conversely, for users who want formatter output even when chef is running
unattended, the `force_formatter` option is provided.

=== Auto Log Level
When `log_level` is set to `:auto` (default), the log level will be `:warn`
when the primary output mode is an output formatter (see
+using_output_formatter?+) and `:info` otherwise.

=== Automatic STDOUT Logging
When `force_logger` is configured (e.g., Chef 10 mode), a second logger
with output on STDOUT is added when running in a console (STDOUT is a tty)
and the configured log_location isn't STDOUT. This accounts for the case
that a user has configured a log_location in client.rb, but is running
chef-client by hand to troubleshoot a problem.

Source | Google | Stack overflow

Edit

git clone [email protected]:opscode/chef.git

cd chef

open lib/chef/application.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Chef--Application-configure_logging-for-pr


# Commit to git

git add lib/chef/application.rbgit commit -m "better docs for Chef::Application#configure_logging"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Chef--Application-configure_logging-for-pr

hub pull-request


# Celebrate!