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

Max Progger updated LOG4J2-902:
-------------------------------
    Description: 
We use ESAPI-framework which is included in coldfusion.

After migration from log4j1 to log4j2 we get a class cast exception error.

{code}
ClassCastException: org.apache.log4j.Logger cannot be cast to 
org.owasp.esapi.Logger
{code}

After analyzing this error, it seems that the class LogManager ignores the 
loggerFactory.

{code}
...
public static Logger getLogger(final String name, final LoggerFactory factory) 
{ 
        return (Logger) Category.getInstance((LoggerContext) 
PrivateManager.getContext(), name);
    }

static Category getInstance(final LoggerContext context, final String name) {
        return getInstance(context, name, loggerFactory); 
    }


{code}

  was:
We use ESAPI-framework which in included in coldfusion.

After migration from log4j1 to log4j2 we get a class cast exception error.

{code}
ClassCastException: org.apache.log4j.Logger cannot be cast to 
org.owasp.esapi.Logger
{code}

After analyzing this error, it seems that the class LogManager ignores the 
loggerFactory.

{code}
...
public static Logger getLogger(final String name, final LoggerFactory factory) 
{ 
        return (Logger) Category.getInstance((LoggerContext) 
PrivateManager.getContext(), name);
    }

static Category getInstance(final LoggerContext context, final String name) {
        return getInstance(context, name, loggerFactory); 
    }


{code}


> Log4j-2-Bridge incompatible to OWSAP ESAPI framework
> ----------------------------------------------------
>
>                 Key: LOG4J2-902
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-902
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.0.2, 2.1
>            Reporter: Max Progger
>
> We use ESAPI-framework which is included in coldfusion.
> After migration from log4j1 to log4j2 we get a class cast exception error.
> {code}
> ClassCastException: org.apache.log4j.Logger cannot be cast to 
> org.owasp.esapi.Logger
> {code}
> After analyzing this error, it seems that the class LogManager ignores the 
> loggerFactory.
> {code}
> ...
> public static Logger getLogger(final String name, final LoggerFactory 
> factory) { 
>         return (Logger) Category.getInstance((LoggerContext) 
> PrivateManager.getContext(), name);
>     }
> static Category getInstance(final LoggerContext context, final String name) {
>         return getInstance(context, name, loggerFactory); 
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to