[jboss-jira] [JBoss JIRA] (WFLY-2437) Update slf4j-api to 1.7.5

Steve McDowell (JIRA) issues at jboss.org
Sun Jul 13 12:50:29 EDT 2014


    [ https://issues.jboss.org/browse/WFLY-2437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984536#comment-12984536 ] 

Steve McDowell commented on WFLY-2437:
--------------------------------------

I am performance testing a web application in Wildfly and profiling it through YourKit.  

I am noticing that there is a large amount of lock contention on org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(String).  This is because the pre-1.7.5 version of jcl-over-slf4j uses a syncronised block in this getInstance method.  I notice that wildfly comes bundled with 1.7.2.  One of the comments above mentions that it is a forked version, however Jad'ing the file reveals that it still uses the old syncronised block.

    public Log getInstance(String name)
        throws LogConfigurationException
    {
        Log instance = null;
        synchronized(loggerMap)
        {
            instance = (Log)loggerMap.get(name);
            if(instance == null)
            {
                org.slf4j.Logger logger = LoggerFactory.getLogger(name);
                if(logger instanceof LocationAwareLogger)
                    instance = new SLF4JLocationAwareLog((LocationAwareLogger)logger);
                else
                    instance = new SLF4JLog(logger);
                loggerMap.put(name, instance);
            }
        }
        return instance;
    }

So, I guess my question is: given that I am using third party jar files that log to JCL and therefore need the more recent version of jcl-over-slf4j, should I manually upgrade the module for wildfly or try to work around it some other way?

Thanks

> Update slf4j-api to 1.7.5
> -------------------------
>
>                 Key: WFLY-2437
>                 URL: https://issues.jboss.org/browse/WFLY-2437
>             Project: WildFly
>          Issue Type: Component  Upgrade
>      Security Level: Public(Everyone can see) 
>          Components: Logging
>    Affects Versions: 8.0.0.Beta1
>            Reporter: Jorge Solorzano
>            Assignee: James Perkins
>              Labels: slf4j
>
> The logger factories in most SLF4J modules namely in jcl-over-slf4j, log4j-over-slf4j, slf4j-jcl, slf4j-jdk14, slf4j-log4j12, and slf4j-simple now use a ConcurrentHashMap instead of a regular HashMap to cache logger instances. This change significantly improves logger retrieval times at the cost of some memory overhead.
> Acording to SLF4J developers:
> Given the significance of these performance improvements, users are highly encouraged to migrate to SLF4J version 1.7.5 or later.



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list