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

Ralph Goers commented on LOG4J2-818:
------------------------------------

You can achieve this by wrapping the SocketAppender in a RewriteAppender such 
as:
{code}
<Appenders>
    <Socket name="socket" host="localhost" port="9500">
      <SerializedLayout />
    </Socket>
    <Rewrite name="rewrite">
      <AppenderRef ref="socket/>
      <MapRewritePolicy mode="Add">
        <KeyValuePair key="application" value="MyApp"/>
      </MapRewritePolicy>
    </Rewrite>
  </Appenders>
{code}

Does that meet your requirements?

> Missing field 'application' in SocketAppender/SerializedLayout/LogEvent
> -----------------------------------------------------------------------
>
>                 Key: LOG4J2-818
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-818
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders, Layouts
>    Affects Versions: 2.0.2
>            Reporter: Benedikt Westphal
>
> The SocketAppender in Log4j1 had a field called 'application' that is missing 
> in the SocketAppender and in the LogEvent of Log4j2. After migration you 
> could not see which application was logging which logmessages on the logging 
> server. The Log4jLogEvent and the SocketAppender should be enhanced to hold 
> this information.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to