0

Given a chef machine resource like the following:

machine "my-server" do
  action :converge_only
end

When this converge happens we sometimes get a chef status of Aborted on manage.chef.io with no further information. This makes it very difficult to troubleshoot issues with the recipes.

I have the following questions:

  • Where is the log on the remote machine?
  • Can I specify the local log location for the converge?
  • Is there a way to rotate the log? It would be useful to be able to go back to previous chef runs and see the logs.
Ben Liyanage
  • 4,993
  • 1
  • 21
  • 23

1 Answers1

0

So to answer my own question, you specify logging in the client.rb. You can append settings to the client.rb via the chef_config property in the machine resource. Here's a small example:

machine "my-server" do
  action :setup
  chef_config "\r\nlog_level :debug\r\nlog_location \"C:\\\\chef\\\\chef-client.#{Time.now.to_i}.log\"\r\n\r\nverbose_logging true"
end

I'm not sure if specifying this on the :converge will do anything. It definitely works on the :setup.

Ben Liyanage
  • 4,993
  • 1
  • 21
  • 23