logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-230) Preempt StackOverflowEx when both slf4j-impl jar and log4j-to-slf4j jar are on the classpath
Date Wed, 01 May 2013 15:28:15 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646644#comment-13646644
] 

Remko Popma commented on LOG4J2-230:
------------------------------------

Added this constructor to org.apache.logging.slf4j.SLF4JLoggerContext

    public SLF4JLoggerContext() {
        // LOG4J2-230, LOG4J2-204 (improve error reporting when misconfigured)
        try {
            Class.forName("org.slf4j.helpers.Log4JLoggerFactory");
            throw new IllegalStateException("slf4j-impl jar is mutually exclusive with log4j-to-slf4j
jar "
                + "(the first routes calls from SLF4J to Log4j, the second from Log4j to SLF4J)");
        } catch (Throwable classNotFoundIsGood) {
            // org.slf4j.helpers.Log4JLoggerFactory is not on classpath. Good!
        }
    }

Committed in revision 1478048. All existing unit tests still work.
                
> Preempt StackOverflowEx when both slf4j-impl jar and log4j-to-slf4j jar are on the classpath
> --------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-230
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-230
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: SLF4J Bridge
>    Affects Versions: 2.0-beta5
>            Reporter: Remko Popma
>
> This ticket is to prevent issues like LOG4J2-204.
> Aiming for something similar to what is documented here:
> http://www.slf4j.org/codes.html#jclDelegationLoop

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message