2 Replies Latest reply on Jan 26, 2006 5:14 PM by nsakiya

    log4j, isDebugEnabled, performance

    klinge

      Hi everybody,
      has anyone run into the problem where you've set your threshold to "INFO" but the function "isDebugEnabled" is still returning "TRUE"?

      Is there a setting for all appenders at the same time?

      This a huge performance problem, because there are some objects with critical toString methods when using logger.XXX only.

      Thanks, Karl

        • 1. Re: log4j, isDebugEnabled, performance
          nsakiya

          I might get the same problem as you mentioned. By setting the following inside an DailyRollingFileAppender:


          log.debug() doesn't print anything into the log file, as expected. But how come isDebugEnabled() always returns true, no matter I set Threshold to INFO or DEBUG? I'm also using TCLFilter inside the appender, but I doubt it has anything to do with this.

          Did I set it wrong? Am I not supposed to set Threshold inside the appender? Any idea?

          Thanks.

          • 2. Re: log4j, isDebugEnabled, performance
            nsakiya

            Sorry, this wasn't properly printed previously.

            <param name="Threshold" value="INFO"/>