Logging configuration

1,244 views
Skip to first unread message

Kal McFate

unread,
Apr 18, 2011, 12:16:13 PM4/18/11
to puppet...@googlegroups.com
How do I tell puppet to log somewhere other than /var/log/messages. None of the logging configuration options seem to do anything any more. Specifically puppetdlog.

    # The log file for puppet agent.  This is generally not used.
    # The default value is '$logdir/puppetd.log'.
    puppetdlog = /var/lib/puppet/log/puppetd.log

Ben Hughes

unread,
Apr 19, 2011, 12:30:31 AM4/19/11
to puppet...@googlegroups.com
On Mon, Apr 18, 2011 at 09:16:13AM -0700, Kal McFate wrote:

> How do I tell puppet to log somewhere other than /var/log/messages. None of
> the logging configuration options seem to do anything any more. Specifically
> puppetdlog.

/var/log/messages, will, I presume, be your syslog daemon's logging.

It logs at syslogfacility daemon by default. Set syslogfacility to
a different level in your puppet.conf and adjust your syslog accordingly.

Or you may use --logdest /path/to/file on the command line if you wish.

--
Ben Hughes || http://www.puppetlabs.com/

Billy The Chip

unread,
Apr 20, 2011, 4:04:54 AM4/20/11
to puppet...@googlegroups.com
As an additional option, you can use rsyslog, which is the default in recent Redhat-ish
distributions and has been available since RH5.2. It's also available for many other Linux
and non-Linux platforms.

On RHEL5, the following works (put this in /etc/rsyslog.conf):
:programname, isequal, "puppet-agent" /var/log/puppet/agent.log
:programname, isequal, "puppet-agent" ~

This might also work for later releases of rsyslog, nevertheless, on
Fedora >= 10 and RHEL6 we use:
if $programname == 'puppet-agent' and $syslogseverity <= '6' then /var/log/puppet/agent.log
if $programname == 'puppet-agent' and $syslogseverity <= '6' then ~

HTH,
Gerald

Roumen

unread,
Nov 7, 2013, 2:20:45 AM11/7/13
to puppet...@googlegroups.com
Billy The Chip <billythechip <at> gmail.com> writes:

>
>
> On Tue, Apr 19, 2011 at 6:30 AM, Ben Hughes <ben <at> puppetlabs.com> wrote:
> On Mon, Apr 18, 2011 at 09:16:13AM -0700, Kal McFate wrote:
> > How do I tell puppet to log somewhere other than /var/log/messages. None of
> > the logging configuration options seem to do anything any more. Specifically
> > puppetdlog.
> /var/log/messages, will, I presume, be your syslog daemon's logging.
> It logs at syslogfacility daemon by default. Set syslogfacility to
> a different level in your puppet.conf and adjust your syslog accordingly.
> Or you may use --logdest /path/to/file on the command line if you wish.
>
>
>
>
> As an additional option, you can use rsyslog, which is the default in
recent Redhat-ish distributions and has been available since RH5.2. It's
also available for many other Linux
> and non-Linux platforms.On RHEL5, the following works (put this in
/etc/rsyslog.conf)::programname, isequal, "puppet-agent"
/var/log/puppet/agent.log:programname, isequal, "puppet-agent" ~This might
also work for later releases of rsyslog, nevertheless, on Fedora >= 10 and
RHEL6 we use:if $programname == 'puppet-agent' and $syslogseverity <= '6'
then /var/log/puppet/agent.log
> if $programname == 'puppet-agent' and $syslogseverity <= '6' then ~HTH,Gerald
>


Just wanted to add, here's how you add a "--logdest=" option to the two
major distributions: redhat and Debian:
On redhat, add "PUPPET_LOG=/var/log/puppet-agent.log" to /etc/sysconfig/puppet
On Debian, add to /etc/default/puppet the following:
LOG_DEST=/var/log/puppet-agent.log
DAEMON_OPTS="--logdest=${LOG_DEST}"
--




Reply all
Reply to author
Forward
0 new messages