You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Atul Pendse (Jira)" <ji...@apache.org> on 2021/12/23 09:58:00 UTC

[jira] [Created] (LOG4J2-3280) Support for microsecond precision in RFC5424Layout

Atul Pendse created LOG4J2-3280:
-----------------------------------

             Summary: Support for microsecond precision in RFC5424Layout
                 Key: LOG4J2-3280
                 URL: https://issues.apache.org/jira/browse/LOG4J2-3280
             Project: Log4j 2
          Issue Type: New Feature
          Components: Layouts
    Affects Versions: 2.17.0, 2.0
         Environment: Tomcat 8.5.x

Java 11

log4j 2.17.0
            Reporter: Atul Pendse


{color:#000000}Our application sends syslog messages to a centralized facility which requires timestamps to be in microsecond format.{color}
{color:#000000}Our application was so far using log4j 1.12.5’s Syslog appender to send syslog messages, which used to format timestamps with microsecond precision.{color}

{color:#000000}We are now upgrading to log4j 2.17.0, and don’t see any way to get microseconds included in timestamp for syslog.{color}

{color:#000000}I am trying to log messages using SyslogAppender with RFC5424 layout.{color}
{color:#000000}I see that RFC5424Layout.java restricts timestamp to millisecond precision (e.g. 2021-12-22T22:54:33.889-08:00).{color}

{color:#000000}RFC5424 specification also mentions support for microsecond precision. Here is some text from {color}[https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.3]

{color:#000000}Example 4{color}

{color:#000000}         2003-08-24T05:14:15.000003-07:00{color}

{color:#000000}   This represents 24 August 2003 at 05:14:15am, 3 microseconds into the{color}
{color:#000000}   next second.  The microsecond resolution is indicated by the{color}
{color:#000000}   additional digits in TIME-SECFRAC.  The timestamp indicates that its{color}
{color:#000000}   local time is -7 hours from UTC.  This timestamp might be created in{color}
{color:#000000}   the US Pacific time zone during daylight savings time.{color}

 

{color:#000000}The RFE is to add support for microsecond precision while formatting timestamp in RFC5424 layout{color}

{color:#000000}A new layout attribute to define millisecond/microsecond precision would be a preferred way.{color}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)