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 "Ralph Goers (JIRA)" <ji...@apache.org> on 2014/11/18 16:34:34 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=14216308#comment-14216308 ] 

Ralph Goers commented on LOG4J2-902:
------------------------------------

It would seem that you have implemented your own custom Loggers on top of Log4j 1.x.  These will not work with Log4j 2, which is precisely why the LoggerFactory is ignored.

> 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