Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-14214

[GSS](7.1.z) Logger.getEffectiveLevel() not working correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.1.5.CR1, 7.1.5.GA
    • 7.1.0.GA
    • Logging
    • None
    • Workaround Exists
    • Hide

      Instead of using Logger.getEffectiveLevel() and checking the level, you can use Logger.isDebugEnabled() or the analogous method for whichever level you are concerned with.

      Show
      Instead of using Logger.getEffectiveLevel() and checking the level, you can use Logger.isDebugEnabled() or the analogous method for whichever level you are concerned with.
    • Hide

      First you need to add this logging configuration in your standalone.xml:

      <logger category="de.der.sample.business">
      <level name="TRACE"/>
      </logger>

      A test webservice project is attached. Deploy it and call the webservice using SoapUI or any test client. You will see the values returned by getEffectiveLevel() and also isTraceEnabled() and isDebugEnabled(). The isLevelEnabled() methods return correctly but getEffectiveLevel() sometimes returns TRACE and sometimes DEBUG. You may need to redeploy several times to see both values.

      Show
      First you need to add this logging configuration in your standalone.xml: <logger category="de.der.sample.business"> <level name="TRACE"/> </logger> A test webservice project is attached. Deploy it and call the webservice using SoapUI or any test client. You will see the values returned by getEffectiveLevel() and also isTraceEnabled() and isDebugEnabled(). The isLevelEnabled() methods return correctly but getEffectiveLevel() sometimes returns TRACE and sometimes DEBUG. You may need to redeploy several times to see both values.

      The Logger.getEffectiveLevel() method doesn't seem to return correct values.

      In a test, we set the log level for a category to TRACE and the method sometimes returns TRACE and sometimes returns DEBUG. Whichever value is returns stays the same until the next time the application is deployed at which point it may change.

      The same behavior seems to exist as well on EAP 7.0 and EAP 6.4.

              rhn-support-iweiss Ingo Weiss
              rhn-support-dboeren David Boeren
              Peter Mackay Peter Mackay
              Peter Mackay Peter Mackay
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d