Log4j 2
  1. Log4j 2
  2. LOG4J2-430

RFC5424Layout not working with parametrized messages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9, 2.0-rc1
    • Fix Version/s: 2.0-rc1
    • Component/s: Core
    • Labels:
    • Environment:

      Java 1.7.0_40

      Description

      Syslog (i.e RFC5424Layout) does not work with parametrized messages. If I do something like this:

      logger.info("Hello {}", "World");
      

      I get this at the syslog server:

      Oct 16 18:24:33 10.0.0.3 myApp Hello {}
      

      This is the config file I'm using:

      <?xml version="1.0" encoding="UTF-8"?>
      <Configuration>
        <Appenders>
          <Console name="STDOUT" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{ISO8601}: %-5p [%t-%c{2}] - %m%n"/>
          </Console>
          <Syslog name="syslog" format="RFC5424" host="10.0.0.1" port="514" protocol="TCP" appName="myApp" facility="LOCAL0" newLine="true" includeMDC="true" id="App" reconnectionDelay="1000"/>
        </Appenders>
        <Loggers>
          <Root level="debug">
            <AppenderRef ref="STDOUT"/>
            <AppenderRef ref="syslog"/>
          </Root>
        </Loggers>
      </Configuration>
      

      The log to stdout is ok though.

      Attached you find my patch for this bug.

        Activity

        David Gstir made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        David Gstir added a comment -

        Is working. Thanks!

        Show
        David Gstir added a comment - Is working. Thanks!
        Ralph Goers made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0-rc1 [ 12325011 ]
        Resolution Fixed [ 1 ]
        Hide
        Ralph Goers added a comment -

        A slightly modified version of your patch was applied in revision 1555454. Please verify and close.

        Show
        Ralph Goers added a comment - A slightly modified version of your patch was applied in revision 1555454. Please verify and close.
        David Gstir made changes -
        Field Original Value New Value
        Attachment rfc5424_parametrized_message_bug.patch [ 12608768 ]
        David Gstir created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            David Gstir
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development