You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2008/09/08 03:08:05 UTC

DO NOT REPLY [Bug 45757] New: JULAppenderTest and setUseParentHandlers(false)

https://issues.apache.org/bugzilla/show_bug.cgi?id=45757

           Summary: JULAppenderTest and setUseParentHandlers(false)
           Product: Log4j
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: javabrett@gmail.com


Created an attachment (id=22536)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22536)
Candidate patch

For
/jul-to-log4j-bridge/src/test/java/org/apache/log4j/jul/JULAppenderTest.java ,
there is a commented out line of code:

//julLogger.setUseParentHandlers(false);

Without the call to julLogger.setUseParentHandlers(false), tests run fine in my
IDE, but fail with a StackOverflowError when run from mvn, due to recursive
calls to parent handlers.  Stack pattern looks like this:

...
at org.apache.log4j.jul.JULAppender.append(JULAppender.java:199)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at
org.apache.logging.julbridge.JULBridgeHandler.publish(JULBridgeHandler.java:53)
        at java.util.logging.Logger.log(Logger.java:472)
        at java.util.logging.Logger.doLog(Logger.java:494)
        at java.util.logging.Logger.log(Logger.java:517)
        at org.apache.log4j.jul.JULAppender.append(JULAppender.java:199)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at
org.apache.logging.julbridge.JULBridgeHandler.publish(JULBridgeHandler.java:53)
        at java.util.logging.Logger.log(Logger.java:472)
        at java.util.logging.Logger.doLog(Logger.java:494)
        at java.util.logging.Logger.log(Logger.java:517)
        at org.apache.log4j.jul.JULAppender.append(JULAppender.java:199)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at
org.apache.logging.julbridge.JULBridgeHandler.publish(JULBridgeHandler.java:53)
        at java.util.logging.Logger.log(Logger.java:472)
        at java.util.logging.Logger.doLog(Logger.java:494)
        at java.util.logging.Logger.log(Logger.java:517)
        at org.apache.log4j.jul.JULAppender.append(JULAppender.java:199)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at
org.apache.logging.julbridge.JULBridgeHandler.publish(JULBridgeHandler.java:53)
        at java.util.logging.Logger.log(Logger.java:472)
        at java.util.logging.Logger.doLog(Logger.java:494)
        at java.util.logging.Logger.log(Logger.java:517)
        at org.apache.log4j.jul.JULAppender.append(JULAppender.java:199)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at
org.apache.logging.julbridge.JULBridgeHandler.publish(JULBridgeHandler.java:53)
        at java.util.logging.Logger.log(Logger.java:472)
        at java.util.logging.Logger.doLog(Logger.java:494)
        at java.util.logging.Logger.log(Logger.java:517)
        at org.apache.log4j.jul.JULAppender.append(JULAppender.java:199)

I'm not sure what the impact is on the test of disabling parent handlers.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45757] JULAppenderTest and setUseParentHandlers(false)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45757


Brett Randall <ja...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Brett Randall <ja...@gmail.com>  2008-09-17 14:31:24 PST ---
Now appears to be resolved in HEAD.  Thanks Paul.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45757] JULAppenderTest and setUseParentHandlers(false)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45757





--- Comment #1 from Paul Smith <ps...@apache.org>  2008-09-07 19:56:43 PST ---
I think I remember thinking the same thing here (hence the commented out, but
probably needed to be put back in).

I'll have a further think about why I commented it out again, because there
must have been some reason.. :)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45757] JULAppenderTest and setUseParentHandlers(false)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45757





--- Comment #2 from Paul Smith <ps...@apache.org>  2008-09-14 20:16:03 PST ---
I believe this is because a _previous_ test run had not cleaned up after
itself.  I saw a similar problem to hear in a different area and I solved it by
properly repatriating in the teardown of each test.

Could you check with the lastest HEAD if this is still a problem?  


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org