How can i store the logs generated by running chef client and what is the way to check afterwards whether the software installation was completed successfully or not.
From which point we can check this from our logs.
I want to store the logs which i see on screen after running chef client
The best way is running chef-client with push jobs. For this you have to install opscode-reporting-1.6.6-1.el7.x86_64.rpm in chef-server.
The command for running chef-client from workstation:
knife job start --capture 'chef-client ’ node_name
knife job output 6b32cda1173231f54ee6b1b7eaa83ad2 node_name --> With this command you can get the logs.
if you are using chef-client in pull mode, then update /etc/chef/client.rb file with the below content;.
log_level :info
log_location ‘/var/log/chef.log’
It will send logs to a file /var/log/chef.log. You can not change output settings when pushing configuration using knife.
Thanks,
Lokesh Jangir
1 Like