Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-375

Performance: OWB logging performs operations when logging disabled.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0.0-alpha-1
    • 1.0.0-alpha-1
    • Core
    • None

    Description

      Logging operations in OWB code are not guarded by Logger.isLoggable(..) or something similar and results in Strings being processed when logging is disabled.

      Here's an example from AbstractInjectable:

      logger.debug("Injected into bean : " + this.injectionOwnerBean.toString() + " with injection point : " + injectionPoint);

      The String concatenation above will occur whether or not logging is enabled. WebBeansLogger should be modified so that the above can be changed to:
      if(logger.isDebugEnabed())
      logger.debug("Injected into bean : " + this.injectionOwnerBean.toString() + " with injection point : " + injectionPoint);

      Generally speaking, it's best for logging statements to be guarded by an isEnabled() flag to prevent performance impacts.

      Attachments

        1. logging_update.patch
          75 kB
          Paul J. Reder

        Activity

          People

            gerdogdu Gurkan Erdogdu
            jdlegget Jacquelle Leggett
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: