chef / chef-apply

The ad-hoc execution tool for the Chef ecosystem.
https://www.chef.sh/
Apache License 2.0
14 stars 14 forks source link

Log level of chef-client running on the target hosts is stuck at default value #26

Closed karthanistyr closed 6 years ago

karthanistyr commented 6 years ago

Description

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

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?

Actual:

* log[demonstrate_verbosity] action write

Stacktrace

N/A

karthanistyr commented 6 years ago

@robbkidd Hi, is there any feedback on this and #28 ?