puppet log file in redhat and centos

29,087

Solution 1

By default, log entries of puppet is saving in /var/log/messages(Redhat-Like Linux).

https://docs.puppetlabs.com/pe/latest/install_what_and_where.html#log-files

For logging into /var/log/puppet/puppet.log, you can uncomment related line in /etc/sysconfig/puppet .

# The puppetmaster server
#PUPPET_SERVER=puppet

# If you wish to specify the port to connect to do so here
#PUPPET_PORT=8140

# Where to log to. Specify syslog to send log messages to the system log.
PUPPET_LOG=/var/log/puppet/puppet.log

# You may specify other parameters to the puppet client here
#PUPPET_EXTRA_OPTS=--waitforcert=500

Solution 2

If you are looking for the log from a puppet run instead of all puppet logs, here is another method:

The summary (and report) of the last puppet run on a node are recorded in /var/lib/puppet/state/last_run_summary.yaml (and last_run_report.yaml). The report is a full log of the previous run, while the summary is brief overview.

They have information that you may not be able to easily get from the normal log file, which is useful if you just need to check the most recent puppet agent run.

Share:
29,087

Related videos on Youtube

Henry Vu
Author by

Henry Vu

Updated on May 20, 2020

Comments

  • Henry Vu
    Henry Vu almost 4 years

    I am running puppet agent in CentOS and Redhat. I would like to see its log file but cannot find it. In these operating systems, I clearly specify logdir = /var/log/puppet in the puppet.conf, but upon checking this directory, it is empty.

    Note that I did similar thing for Ubuntu and SUSE and it worked well. The issue only happened in Redhat and CentOS. Any idea of where to look for the log file in these cases?

    Thanks, Henry

Related