Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4650

Use SLF4J parameterized logging instead of String concatenation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      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.

      logger.debug("The new entry is "+entry+".");
      logger.debug("The new entry is {}.", entry);
      

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              milleruntime Michael Miller
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: