Information Technology Reference
In-Depth Information
Synchronizing Cookbooks:
Compiling Cookbooks...
[2014-08-14T12:28:46-07:00] WARN: Node default-centos65.vagrantup.com has an
empty run list.
Converging 1 resources
Recipe: @recipe_files::/learningchef/hello.rb
* log[Hello, this is an important message.] action write
Running handlers:
Running handlers complete
Chef Client finished, 1/1 resources updated in 2.308460088 seconds
During your chef-client run, the following output indicates that “Hello, this is an import-
ant message.” was written to the log for the Chef run:
log[Hello, this is an important message.] action write
To actually see the log message, you need to change the chef-client log level. Every mes-
sage written to the log has severity level. The levels, in order of priority from lowest to
highest, are debug , info , warn , error , and fatal . The log resource uses the info level as a
default, which is appropriate for your “Hello” message. However, chef-client only prints
out messages of severity warn or greater unless you change the chef-client log level.
To change the log level, use the --log_level option. The --log_level option takes a para-
meter ( --log_level <level>), changing the lowest level severity messages chef-client
will write to its log. If you add the option --log_level info to your chef-client com-
mand line, it will display the log message you just added. Try that now:
[vagrant@default-centos65 learningchef]$ chef-client --local-mode hello.rb \
--log_level info
[2014-08-14T12:30:43-07:00] WARN: No config file found or specified on command
line, using command line options.
[2014-08-14T12:30:43-07:00] WARN: No cookbooks directory found at or above
current directory. Assuming /learningchef.
[2014-08-14T12:30:43-07:00] INFO: Starting chef-zero on host localhost, port
8889 with repository at repository at /learningchef
One version per cookbook
...
Converging 1 resources
Recipe: @recipe_files::/learningchef/hello.rb
Search WWH ::




Custom Search