It is not possible to influence the verbosity of the log output from the chef-client process on the target host. The automatically written workstation.rb config file to be used by chef-client omits setting the log_level parameter, which then probably should default to auto as per client.rb documentation:
log_level
The level of logging to be stored in a log file.
Possible levels: :auto (default), :debug, :info, :warn, :error, or :fatal.
Default value: :warn (when a terminal is available) or :info (when a terminal is not available).
I haven't been digging to the bottom of it, but my experience shows that chef-client thinks it's being run with a terminal available, since the output is of warn level (maybe because of ssh?), and less important output is silenced.
I think it's reasonable to expect to receive from the remote chef-client a log with output of a user-set importance level.
Optionally, chef-client runs that are executed as part of a chef-apply run should probably default to another log level, perhaps info would be suitable (it would make sense in a way, since chef-client is executed remotely and should not consider having a terminal at disposal).
Chef Apply Version
All versions up to 0.1.13 (latest as of writing)
Platform Version
Arch Linux patch to latest as of writing
Replication Case
Write recipe with a log output of importance less than warn (say, info)
log "demonstrate_verbosity" do
message "This is an unimportant log line but maybe still interesting?"
level :info
end
Run recipe via chef-run myhost path/to/recipe.rb
Client Output
Expected:
* log[demonstrate_verbosity] action write
[2018-07-26T18:46:58+02:00] INFO: Processing log[demonstrate_verbosity] action write (cookbook::recipe line 1)
[2018-07-26T18:46:58+02:00] INFO: This is an unimportant log line but maybe still interesting?
Description
It is not possible to influence the verbosity of the log output from the
chef-client
process on the target host. The automatically writtenworkstation.rb
config file to be used bychef-client
omits setting thelog_level
parameter, which then probably should default toauto
as per client.rb documentation:I haven't been digging to the bottom of it, but my experience shows that
chef-client
thinks it's being run with a terminal available, since the output is ofwarn
level (maybe because of ssh?), and less important output is silenced.I think it's reasonable to expect to receive from the remote
chef-client
a log with output of a user-set importance level.Optionally,
chef-client
runs that are executed as part of achef-apply
run should probably default to another log level, perhapsinfo
would be suitable (it would make sense in a way, sincechef-client
is executed remotely and should not consider having a terminal at disposal).Chef Apply Version
All versions up to 0.1.13 (latest as of writing)
Platform Version
Arch Linux patch to latest as of writing
Replication Case
warn
(say,info
)chef-run myhost path/to/recipe.rb
Client Output
Expected:
Actual:
Stacktrace
N/A