5 Replies Latest reply on May 14, 2008 3:37 AM by Tim Fox

    log.isTraceEnabled() and performance

    Tim Fox Master

      In performance critical sections of the code we should avoid code like:

      if (log.isTraceEnabled())
      {
       log.trace("Something");
      }
      


      The problem is that the call to log.isTraceEnabled() actually takes up significant time. This is why you'll see in the code the following:

      if (trace)
      {
       log.trace("okjok");
      }
      


      Instead.