Method: ChefApply::Startup#setup_logging

Defined in:
lib/chef_apply/startup.rb

#setup_loggingObject



176
177
178
179
180
181
182
183
184
185
# File 'lib/chef_apply/startup.rb', line 176

def setup_logging
  ChefApply::Log.setup(Config.log.location, Config.log.level.to_sym)
  ChefApply::Log.info("Initialized logger")

  ChefConfig.logger = ChefApply::Log
  # Setting the config isn't enough, we need to ensure the logger is initialized
  # or automatic initialization will still go to stdout
  Chef::Log.init(ChefApply::Log.location)
  Chef::Log.level = ChefApply::Log.level
end