Skip to content
Advertisement

Tag: rsyslog

How to log to /var/log/mail.log using rsyslogd?

I am currently playing around with logging under Linux. I have made the following very simple test application (in plain C): This “application” compiles, and when I execute it, it generates an entry in /var/log/syslog, but no entry in /var/log/mail.log and no entry in /var/log/mail.err. Could somebody please explain why? I am using rsyslogd on the test machine; this is

Generate log4j timestamp format in linux date

I want to mimic the format used in log4j for timestamps using the linux date (just some quick scripting) On log4j the format is defined as %d{dd MMM yyyy HH:mm:ss,SSS} That would translate into lines like: 2016-03-10 07:01:09,778 2016-03-10 07:01:09,784 Can this be accomplished in date? The closer I got was using But this still has 9 digits instead of

Advertisement