Debug logging chef in Vagrant

Recently I wanted to enable debug level logging of chef-solo runs in a vagrant box. As it turns out there are two ways to do this and both appear to be undocumented:

 Vagrant.configure("2") do |config|
    # ...
    config.vm.provision :chef_solo do |chef|
      chef.arguments = '-l debug'
      # ...
    end
 end
 Vagrant.configure("2") do |config|
    # ...
    config.vm.provision :chef_solo do |chef|
      chef.log_level = :debug
      # ...
    end
 end

Sources: http://stackoverflow.com/a/18778690https://coderwall.com/p/covmpg

Leave a Reply

Your email address will not be published. Required fields are marked *