logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1010) Injectable context properties
Date Thu, 23 Jun 2016 16:57:16 GMT

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

Remko Popma commented on LOG4J2-1010:

The beauty of this approach is that it would provide a generic solution for this ticket as
well as help solve LOG4J2-1401 and LOG4J2-1349. 

There have also been user requests in the past (cannot find the Jira now) to allow putting
custom data in the LogEvent to be consumed by custom Layouts or Appenders. These are rare
cases but until now the only answer we had was "put a String key-value pair in the ThreadContext
map". With this approach users can provide their own injector to put data of arbitrary type
in the log event.

> Injectable context properties
> -----------------------------
>                 Key: LOG4J2-1010
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1010
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: 2.2
>            Reporter: Mikael Ståldal
>         Attachments: properties.patch
> It would be useful to have a way to inject context properties into a {{LogEvent}}, as
an alternative to {{ThreadContext}}.
> In an asynchronous environment, using ThreadContext as currently implemented is not so
useful since JVM threads might not be coupled to the logical flow of the application.

This message was sent by Atlassian JIRA

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

View raw message