You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2014/01/12 17:19:51 UTC

[jira] [Resolved] (LOG4J2-479) Use of InheritableThreadLocal in Map ThreadContext is dangerous and unhelpful

     [ https://issues.apache.org/jira/browse/LOG4J2-479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma resolved LOG4J2-479.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-rc1

I made changes to {{DefaultThreadContextMap}} so that it now uses a plain {{ThreadLocal}} by default. {{InheritableThreadLocal}} is used if system property {{isThreadContextMapInheritable}} has value {{"true"}}.

Also updated the Thread Context manual page (http://logging.apache.org/log4j/2.x/manual/thread-context.html ).

Fixed in revision 1557551.
Please verify and close.

> Use of InheritableThreadLocal in Map ThreadContext is dangerous and unhelpful
> -----------------------------------------------------------------------------
>
>                 Key: LOG4J2-479
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-479
>             Project: Log4j 2
>          Issue Type: Bug
>            Reporter: MK
>            Assignee: Remko Popma
>             Fix For: 2.0-rc1
>
>
> Described here http://logging.apache.org/log4j/2.x/manual/thread-context.html
> The use of InheritableThreadLocal creates subtle and hard to track bugs while not really adding much useful.  It is counterintuitive -- I don't see why would anyone expect logging context to be inherited.  But it breaks down completely when used with Thread Executors.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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