syslog icon indicating copy to clipboard operation
syslog copied to clipboard

Remove duplicate timestamp

Open smpallen99 opened this issue 11 years ago • 3 comments

Currently, the timestamp is printed twice for each log entry. Need to use the Logger.Formatter.format in such a way so that it does not include a timestamp, since I believe that syslog is picky on the timestamp field and must be provided as part of the header of the UDP message.

smpallen99 avatar Aug 06 '14 14:08 smpallen99

To solve this you can provide a different default formatter. For example one that is identical to the standard default except no timestamp:

Keyword.get(opts, :format, "$metadata[$level] $levelpad$message\n")

Instead of creating a new timestamp, the timestamp sent by Logger with the event (ts in your case) can be used. It is of the form (all integers):

{{year, month, day}, {hour, minutes, seconds, milliseconds}}

fishcakez avatar Aug 06 '14 22:08 fishcakez

@fishcakez yup that seems more consistent than crafting new timestamp in the backend

wkhere avatar Aug 06 '14 23:08 wkhere

So looks like the timestamp code in Utils is to be trashed anyway ;)

wkhere avatar Aug 06 '14 23:08 wkhere