How to capture a chef :: Log.info in a kitchen dough

When i started

   kitchen test

or

   kitchen test --log-level info

There are no logs that I have in my test recipe, i.e.

   Chef::Log.info("How to make appear in kitchen output?")

displayed on the kitchen exit to the console. Anyway, for this to happen?

driver: tramp

creator: chef-solo

Thanks,

+4
source share
2 answers

You can set a detailed level when starting a test kitchen, for example. kitchen test -l debug. What you see is that by default Chef runs on WARN and higher, so by default INFO is hidden. This is true for chef-client. Using a command -l debugin your kitchen, the command -l debugwill pass the command chef-client, and then you will also see the INFO level logs.

+1

: Martin 1.7.0 (. # 950).

: " Kitchen 1.7.0 ".

log_level .kitchen.yml:

provisioner: name: chef-zero log_level: <%= ENV['CHEF_LOG_LEVEL'] || auto %>

, :

  • Chef::Log.debug kitchen converge -l debug.
  • Chef::Log.debug log_level: debug .kitchen.yml.
+4

Source: https://habr.com/ru/post/1608580/


All Articles