有没有办法轻松更改Chef运行脚本的标准输出? 我的意思是厨师正在为普通用户写下许多无用的信息,例如:
[2015-08-06T12:09:30+02:00] INFO: Storing updated cookbooks/windows/resources/auto_run.rb in the cache.
[2015-08-06T12:09:30+02:00] INFO: Storing updated cookbooks/windows/resources/batch.rb in the cache.
[2015-08-06T12:09:30+02:00] INFO: Storing updated cookbooks/windows/resources/feature.rb in the cache.
[2015-08-06T12:09:30+02:00] INFO: Storing updated cookbooks/windows/resources/certificate_binding.rb in the cache.
[2015-08-06T12:09:30+02:00] INFO: Storing updated cookbooks/windows/resources/certificate.rb in the cache.
[2015-08-06T12:09:30+02:00] INFO: Storing updated cookbooks/windows/resources/font.rb in the cache.
等。对我而言,它应该更像是调试信息......
普通用户希望看到特定于应用的信息,例如:
[2015-08-06T12:09:33+02:00] WARN: You're about to remove these resources from your system:
[2015-08-06T12:09:33+02:00] WARN: - App a (path_to_a)
[2015-08-06T12:09:33+02:00] WARN: - App b (path_to_b)
[2015-08-06T12:09:33+02:00] WARN: - App c (path_to_c)
但是这些信息无法从日志中轻松读取,因为还有大量其他Chef信息。
正如您在我的示例中所看到的,我已经采用了另一种方式:我已将日志设置为warn
级别,并将Chef日志设置为仅显示警告,方法是将这些行添加到配置中。 RB:
log_level :warn
log_location "#{path}/log.txt"
这很有效,但用户对WARN
而不是INFO
字感到恼火。而且我想以某种方式显示与信息不同的警告...
那么 - 有没有办法禁用标准Chef输出?我没有编辑Chef安装 - 只有配置文件或类似的东西。
规格: