[logback-user] SyslogAppender header with timestamp? Jan 01 01:00:00

Andreas Kruthoff andreas.kruthoff at nexustelecom.com
Wed May 22 15:52:23 CEST 2013


Hi


Problem is solved, syslogd is logging the timestamp. I missed to set the
timestamp in my event.

...
ch.qos.logback.classic.spi.LoggingEvent event = new LoggingEvent();
event.setTimeStamp(System.currentTimeMillis()); // this was missing
...

Without setting the timestamp, the event used ts=0, which was converted
to Jan 01 01:00:00.


cheers

-andreas

On 05/22/2013 02:54 PM, Andreas Kruthoff wrote:
> Hi
>
>
> I'm using the SyslogAppender and am writing to a remote syslogd, using a
> local1.info facility and a logfile.
>
> All messages in syslog have the timestamp "Jan 01 01:00:00".
>
> As I can't influence the layout of this appender
> (http://logback.qos.ch/codes.html#syslog_layout), I wonder where this
> timestamp comes from. I've used wireshark and seen that logback is
> sending this date to syslogd. Is this a defect or am I missing something?
>
> I've checked log4j with wireshark. The header isn't created, and there's
> no timestamp in the transmitted message. Syslog is filling in its own
> timestamp in this case, which is correct.
>
> logback 1.0.12
> solaris 10.
>
>
> thx
>
> -andreas
>

This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment.



More information about the Logback-user mailing list