Method: Chef::Application#configure_log_location
- Defined in:
- lib/chef/application.rb
#configure_log_location ⇒ Object
merge Chef::Config and config
- the nil default value of log_location_cli means STDOUT
- the nil default value of log_location is removed
- Arrays are supported
- syslog + winevt are converted to those specific logger objects
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/chef/application.rb', line 195 def configure_log_location log_location_cli = [ config[:log_location_cli] ].flatten.map { |log_location| log_location.nil? ? STDOUT : log_location } chef_config[:log_location] = [ chef_config[:log_location], log_location_cli ].flatten.compact.uniq chef_config[:log_location].map! do |log_location| case log_location when :syslog, "syslog" force_force_logger logger::Syslog.new when :win_evt, "win_evt" force_force_logger logger::WinEvt.new else # should be a path or STDOUT log_location end end end |