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

Mikael Ståldal edited comment on LOG4J2-1010 at 6/23/16 8:35 AM:
-----------------------------------------------------------------

That might work. However, Twitter Finagle have already implemented all this for 
you with {{Local}} and {{Context}}, without requiring the application to 
explicitly pass the state around like in your example. I would like to leverage 
that.

And the structure of the code is not like in your example, it is a chain of 
futures (Twitter or Scala Future, or 
[CompletableFuture|http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html]
 in Java 8). The application does not manage Threads explicitly.


was (Author: mikaelstaldal):
That might work. However, Twitter Finagle have already implemented all this for 
you with {{Local}} and {{Context}}, without requiring the application to 
explicitly pass the state around like in your example. I would like to leverage 
that.

And the structure of the code is not like in your example, it is a chain of 
futures (Twitter or Scala Future, or 
[CompletableFuture|http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html]
 in Java 8).

> Possibility to set ThreadContext values in calls to Logger method
> -----------------------------------------------------------------
>
>                 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 some logging methods in the Logger interface to 
> set ThreadContext values for a single log message only.
> In an asynchronous environment, using ThreadContext as currently defined 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

Reply via email to