如何在Amazon OpsWorks上为Chef设置日志输出级别? [英] How can I set the log output level for Chef on Amazon OpsWorks?

查看:88
本文介绍了如何在Amazon OpsWorks上为Chef设置日志输出级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题类似于:如何在控制台中显示Opscode Chef bash命令的输出?

我希望能够看到控制台我的运行配方的输出。特别是,我的食谱无法启动JBoss,因为未设置 JAVA_HOME 。我花了整整一天的时间才弄清楚这一点,因为未将 JAVA_HOME语句打印到Chef输出中。运行chef solo时,可以通过在命令后附加 -l debug 来打开调试输出,如下所示: chef-solo -c solo.rb -j node.json -l调试

I want to be able to see console output for my running recipe. In particular, my recipe failed to start JBoss because JAVA_HOME was not being set. It took me an entire day to figure this out because the statement JAVA_HOME is undefined was not being printed to the Chef output. When running chef solo, debugging output can be turned on by appending -l debug to the command, as in: chef-solo -c solo.rb -j node.json -l debug

但是,当使用Amazon OpsWorks时,没有这样的选择:

However, when using Amazon OpsWorks, there is no such option:

sudo opsworks-agent-cli run_command [activity] [date] [/path/to/valid/json.file]

如何向 run_command 添加日志级别?

推荐答案

尝试运行:


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

这篇关于如何在Amazon OpsWorks上为Chef设置日志输出级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆