Enable Rsyslog and Syslog cron events logging in /var/log/cron.log on Debian Lenny

Friday, 9th April 2010

By default Debian doesn’t log it’s cron events in a separate log file.
All the cron events got logged along with all the other syslog events configured by default in either syslog or rsyslog.
So you end up with a /var/log/syslog which includes many versatile messages. That’s really unpleasent if you want to keep track of your cron events separately.
I always change this behaviour while configuring new servers or Desktop systems running Debian.
Therefore I decided to share here what I do to enable separate cron logging. The logged cron events would go to var/log/cron.log.
As a starter please make sure you have the file /var/log/cron.log existing on your filesystem tree, if you have it not then please create it:
debian:~# touch /var/log/cron.log

To configure your crond to log to /var/log/cron.log on a system running syslogd all you have to do is edit /etc/syslog.conf and either include the line:

cron.* /var/log/cron.log
or simply uncomment the same line already laying commented in the syslog.conf.
If you’re using the enhanced version of syslogd for Linux (Rsyslog) the code syntax that is necessery to be included is absolutely identical.
Again you have to include:

cron.* /var/log/cron.log

in /etc/rsyslog.conf or uncomment the line shown above in /etc/rsyslog.conf.

Now last step to do is to reload syslogd or rsyslogd.

With syslogd running on your system execute:

debian:~# killall -HUP syslogd

With rsyslogd as a default system logger:

debian:~# killall -HUP rsyslogd

Now you should have your crond logging to the separate /var/log/cron.log, wish you happy cron.log reading 🙂

Share this on:

Download PDFDownload PDF

Tags: , , , , , , , , ,

2 Responses to “Enable Rsyslog and Syslog cron events logging in /var/log/cron.log on Debian Lenny”

  1. filip says:
    Firefox 14.0.1 Firefox 14.0.1 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1

    thanks man!

    View CommentView Comment
  2. Joulurunot.fi says:
    Google Chrome 13.0.782.112 Google Chrome 13.0.782.112 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

    Ennätys myller pelastustoimi keränen opetushallitus poundsign pankkitili tipahtaa loppusumma
    🙁 ruokailu pääomatulo käyttökelpoinen sven toimintaedellytys aarnio järkyttyä maanalainen nykytaide pelastua wärtsilä
    ?

    View CommentView Comment

Leave a Reply

CommentLuv badge