You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Mike (Jira)" <ji...@apache.org> on 2021/12/19 15:30:00 UTC

[jira] [Updated] (LOG4J2-3257) MDC class in 2.17.0 has multiple "put" methods

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

Mike updated LOG4J2-3257:
-------------------------
    Description: 
We use MDC.put for a variety of things.  With the 2.17 version it appears there is a bug.

When including the jar from maven, we can see the following:

 
{code:java}
private MDC() {
}


public static void put(final String key, final String value) {
    localMap.get().put(key, value);
    ThreadContext.put(key, value);
}


public static void put(final String key, final Object value) {
    localMap.get().put(key, value);
    ThreadContext.put(key, value.toString());
} {code}
Java is very unhappy when trying to call this, and causes problems in our application.

The error we are getting is:

 

  was:
We use MDC.put for a variety of things.  With the 2.17 version it appears there is a bug.

When including the jar from maven, we can see the following:

 
{code:java}
private MDC() {
}


public static void put(final String key, final String value) {
    localMap.get().put(key, value);
    ThreadContext.put(key, value);
}


public static void put(final String key, final Object value) {
    localMap.get().put(key, value);
    ThreadContext.put(key, value.toString());
} {code}
Java is very unhappy when trying to call this, and causes problems in our application


> MDC class in 2.17.0 has multiple "put" methods
> ----------------------------------------------
>
>                 Key: LOG4J2-3257
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3257
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>    Affects Versions: 2.17.0
>            Reporter: Mike
>            Priority: Major
>
> We use MDC.put for a variety of things.  With the 2.17 version it appears there is a bug.
> When including the jar from maven, we can see the following:
>  
> {code:java}
> private MDC() {
> }
> public static void put(final String key, final String value) {
>     localMap.get().put(key, value);
>     ThreadContext.put(key, value);
> }
> public static void put(final String key, final Object value) {
>     localMap.get().put(key, value);
>     ThreadContext.put(key, value.toString());
> } {code}
> Java is very unhappy when trying to call this, and causes problems in our application.
> The error we are getting is:
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)