logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gareth Western (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4J2-355) Add support for multiple SD-ELEMENTs in a RFC 5424 syslog message
Date Tue, 10 Jun 2014 21:11:04 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14027015#comment-14027015
] 

Gareth Western edited comment on LOG4J2-355 at 6/10/14 9:10 PM:
----------------------------------------------------------------

[~btibi] Could you provide an example of using the  LoggerFields with the Syslog appender?
I can't get it to work using the following log4j2.xml:

{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration name="TestConfig" packages="com.garethwestern" monitorInterval="30">
<Appenders>

    <Syslog name="gareth"
            host="localhost"
            port="514"
            protocol="UDP"
            facility="LOCAL4"
            format="RFC5424"">
        <LoggerFields>
            <KeyValuePair key="thread" value="%t"/>
            <KeyValuePair key="priority" value="%p"/>
            <KeyValuePair key="category" value="%c"/>
        </LoggerFields>
    </Syslog>
</Appenders>
<Loggers>
    <Logger name="com.garethwestern" level="debug"/>
    <Root level="warn">
        <AppenderRef ref="gareth"/>
    </Root>
</Loggers>
</Configuration>
{code}

But the messsages appear in my syslog without any pattern. For example:
{code}LOGGER.info("Finished");{code}
appears as
{code}Jun 10 23:09:05 quine TestConfig finished{code}


was (Author: westerg):
[~btibi] Could you provide an example of using the  LoggerFields with the Syslog appender?
I can't get it to work using the following log4j2.xml:

{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration name="TestConfig" packages="com.garethwestern" monitorInterval="30">
<Appenders>

    <Syslog name="gareth"
            host="localhost"
            port="514"
            protocol="UDP"
            facility="LOCAL4"
            format="RFC5424"">
        <LoggerFields>
            <KeyValuePair key="thread" value="%t"/>
            <KeyValuePair key="priority" value="%p"/>
            <KeyValuePair key="category" value="%c"/>
        </LoggerFields>
    </Syslog>
</Appenders>
<Loggers>
    <Logger name="com.garethwestern" level="debug"/>
    <Root level="warn">
        <AppenderRef ref="gareth"/>
    </Root>
</Loggers>
</Configuration>
{code}

But the messsages appear in my syslog without any pattern. For example:
{code}LOGGER.info("Finished");{code}
appears as
{code}Jun 10 23:09:05 quine Gareth finished{code}

> Add support for multiple SD-ELEMENTs in a RFC 5424 syslog message
> -----------------------------------------------------------------
>
>                 Key: LOG4J2-355
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-355
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0-beta9
>            Reporter: Tibor Benke
>             Fix For: 2.0-beta9
>
>         Attachments: LOG4J2-355_v2.patch, LOG4J2-355_v3.patch, LOG4J2-355_v4.patch, add_multime_SD_ELEMENT_support.diff,
eventPrefix_behaviour_demo_testcase.patch
>
>
> The patch contains the modifications to support the feature and I also refactored some
code in the RFC5424Layout.java file.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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


Mime
View raw message