How can I set the log output level for Chef on Amazon OpsWorks?

大憨熊 提交于 2019-12-03 20:19:39

Try running:

cd /opt/aws/opsworks/current
bundle exec chef-solo -l debug -c conf/solo.rb -j /var/lib/aws/opsworks/chef/XXX.json

source: http://docs.aws.amazon.com/opsworks/latest/userguide/troubleshoot.html

Each Chef run produces a log, which provides a detailed description of the run and is a valuable troubleshooting resource. To specify the amount of detail in the log, add a Chef::Log.level statement to a custom recipe that specifies the desired log level. The default value is :info. The following example shows how to set the Chef log level to :debug, which provides the most detailed description of the run.

Chef::Log.level = :debug

In your recipe, add the following

require 'chef/log'
Chef::Log.level = :debug
...

You can also control the log using the custom_json property in stack setting.

{"opsworks":{"chef_log_level":"debug"}}

The above turns on debug for chef and opsworks, but does not yet show the output of the commands you might run using bash or other script.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!