On 04/14/2011 08:07 PM, Lima Union wrote:
On Thu, Apr 14, 2011 at 1:45 PM, /dev/rob0<r...@gmx.co.uk>  wrote:
On Thu, Apr 14, 2011 at 01:19:03PM -0300, Lima Union wrote:
Hi, I believe that this question is slightly OT but I'm seeing this
syslog format in Postfix: "Apr 10 08:53:12 relay1
postfix/cleanup[16550]:.....", my question is if there's a way to
have also printed the year in the date field? while looking for
historic data it can be really useful. I'm running RHEL 5.6 with
the default syslog package, I've looked at the man page and googled
without much success, any ideas? TIA!
Aren't you rotating your logs? Pipe them through sed(1) if desired,
or just save them in a year/month/day directory tree, such that the
year would be part of the pathname.

OK I think that I'll simply switch to rsyslog
Thanks.

There are a lot of tools out there (e.g. pfolgsumm, awstats) that expect the standard syslog format.
I keep both around for a few days, to satisfy all parties.

In rsyslog.conf:

$template MailLogFormat,"%timegenerated:1:10:date-rfc3339% %timegenerated:12:23:date-rfc3339% %source% %syslogtag%%msg%\n"

mail.*                          -/var/log/mail/mail.log;MailLogFormat
mail.*                          -/var/log/mail.log

This puts the standard syslog-formatted log in the normal place, and copies my own format to another location.

HTH

--
J.

Reply via email to