You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "David Gstir (JIRA)" <ji...@apache.org> on 2013/10/16 20:26:41 UTC

[jira] [Created] (LOG4J2-430) RFC5424Layout not working with parametrized messages

David Gstir created LOG4J2-430:
----------------------------------

             Summary: RFC5424Layout not working with parametrized messages
                 Key: LOG4J2-430
                 URL: https://issues.apache.org/jira/browse/LOG4J2-430
             Project: Log4j 2
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0-beta9, 2.0-rc1
         Environment: Java 1.7.0_40

            Reporter: David Gstir
         Attachments: rfc5424_parametrized_message_bug.patch

Syslog (i.e RFC5424Layout) does not work with parametrized messages. If I do something like this:
{code}
logger.info("Hello {}", "World");
{code}

I get this at the syslog server: 
{code}
Oct 16 18:24:33 10.0.0.3 myApp Hello {}
{code}

This is the config file I'm using:
{code:xml:title=log4j2.xml}
<?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>
{code}

The log to stdout is ok though.

Attached you find my patch for this bug.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org