[ https://issues.apache.org/jira/browse/LOG4J2-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346691#comment-15346691 ]
Remko Popma edited comment on LOG4J2-1010 at 6/23/16 4:20 PM: -------------------------------------------------------------- I think there is still some confusion on how to use this. The {{ContextInjector}} interface is not intended to be used by the application. It is only used internally by Log4j. I propose that the Scala module provides a utility class similar to the log4j-api ThreadContext class, that allows users to put key-value pairs in the Finacle Context (or in Locals). _This_ is the API that applications would use. I imagine this utility would be used similarly to the log4j-api ThreadContext. The {{ScalaContextInjector}} implementation would take the key-value pairs out of the Locals and copy them into the LogEvent's CustomData every time something is logged. was (Author: rem...@yahoo.com): I think there is still some confusion on how to use this. This interface is not intended to be used by the application. It is used internally by Log4j. I propose that in the Scala module, you provide a utility class similar to the log4j-api ThreadContext class, that allows users to put key-value pairs in the Finacle Context (or in Locals). _This_ is the API that applications would use. The {{ScalaContextInjector}} implementation would take the key-value pairs out of the Locals and copy them into the LogEvent's CustomData every time something is logged. > 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 (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org