accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Miller (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ACCUMULO-4650) Use SLF4J parameterized logging instead of String concatenation
Date Fri, 09 Jun 2017 17:07:18 GMT
Michael Miller created ACCUMULO-4650:
----------------------------------------

             Summary: Use SLF4J parameterized logging instead of String concatenation
                 Key: ACCUMULO-4650
                 URL: https://issues.apache.org/jira/browse/ACCUMULO-4650
             Project: Accumulo
          Issue Type: Improvement
            Reporter: Michael Miller
            Priority: Minor


The Simple Logging Facade for Java (SLF4J) allows performance improvement of logging with
use of parameterized "{}" log messages.  

The following two lines will yield the exact same output. However, the second form will outperform
the first form by a factor of at least 30, in case of a disabled logging statement.
{code}
logger.debug("The new entry is "+entry+".");
logger.debug("The new entry is {}.", entry);
{code}
See here for reference: https://www.slf4j.org/faq.html#logging_performance

It wouldn't hurt to wrap all debug log statements server side with isDebugEnabled() as well.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message