Stefan Goethals added the ability to specify puppet's log_level in puppet.conf[1] and it will be available in Puppet 4.0. This was originally redmine ticket #4761, so thank you Stefan for resolving that!
I did run into one surprise and wanted to get feedback. If you specify log_level=debug in puppet.conf, and run with `puppet agent --verbose` (or more commonly `puppet agent --test`, which implies `--verbose` and a bunch of other settings), then the agent's log_level will be reset back down to the info level, and you won't get any debug output.
To see debug output, you have to execute `puppet agent --test --debug` or specify a lot of the things `--test` implies, but leave out `--verbose`, e.g `puppet agent --no-daemonize --onetime`
The problem originates in Puppet::Application#set_log_level
if options[:debug]
Puppet::Util::Log.level = :debug
elsif options[:verbose]
Puppet::Util::Log.level = :info
end
The code assumes that if debug is not specified on the command line, but verbose is, then the log level must be info. If the log level is set to debug in puppet.conf, then this will actually downgrade the logging level to info.
We could fix this a few different ways.
1. If --verbose (or --test) is specified, then ensure the log_level is *at least* at the info level
2. Change --test to imply --debug instead of --verbose
3. Something else?
Josh