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 "Max Progger (JIRA)" <ji...@apache.org> on 2014/11/18 15:54:35 UTC

[jira] [Updated] (LOG4J2-902) Log4j-2-Bridge incompatible to OWSAP ESAPI framework

     [ 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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org