puppet keeps writing to syslog /var/log/messages file

asked 2017-03-13 09:52:20 -0500

stratmajik gravatar image

updated 2017-03-14 07:41:35 -0500

Hello,

I'm running puppetserver 4.9.4 in master-agent environment on CentOS 6.8. I understand that puppet by default writes to the /var/log/messages file when it's running as a daemon, which mine is. I read that I can redirect that to a different file. Below is what I did.

Added this below to the /etc/puppetlabs/puppet/puppet.conf file under the [agent] heading syslogfacility = local6

Added this below to the /etc/rsyslog.conf file. I confirmed that nothing else was using local6.* local6.* /var/log/puppet.log

Ran these two commands below for the settings to take effect. service rsyslog restart service puppet restart

Ran puppet agent --test on the agent and it did write to the /var/log/puppet.log file. However, it's still writing to /var/log/messages.

I also have the line below set in the /etc/sysconfig/puppet file. PUPPETEXTRAOPTS=--logdest=/var/log/puppetlabs/puppet/puppet-agent.log

Below is an example of what I see in /var/log/messages.

Mar 14 07:37:35 sbxpuppetagent1 puppet-agent[15873]: Using configured environment 'production' Mar 14 07:37:35 sbxpuppetagent1 puppet-agent[15873]: Retrieving pluginfacts Mar 14 07:37:35 sbxpuppetagent1 puppet-agent[15873]: Retrieving plugin Mar 14 07:37:36 sbxpuppetagent1 puppet-agent[15873]: Loading facts Mar 14 07:37:37 sbxpuppetagent1 puppet-agent[15873]: Caching catalog for sbxpuppetagent1.sbxpod.local Mar 14 07:37:38 sbxpuppetagent1 puppet-agent[15873]: Applying configuration version '1489495057' Mar 14 07:37:38 sbxpuppetagent1 puppet-agent[15873]: Applied catalog in 0.85 seconds

What am I missing to avoid it from writing to /var/log/messages?

Thanks, Mike

edit retag flag offensive close merge delete

Comments

Can you give an example of the messages that are still being written to /var/log/messages?

smarlow gravatar imagesmarlow ( 2017-03-13 14:02:02 -0500 )edit

Added to original post what I see in /var/log/messages. I just noticed these things. 1. If I ran puppet agent --test then it will add to both messages and my custom log. 2. If I waited for the agent to poll the server automatically it will not write to messages. Is this the expected behavior?

stratmajik gravatar imagestratmajik ( 2017-03-14 07:45:33 -0500 )edit