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 2007/12/07 19:29:17 UTC

DO NOT REPLY [Bug 44038] New: - log4j is susceptible to exceptions thrown by Exception classes

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44038>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44038

           Summary: log4j is susceptible to exceptions thrown by Exception
                    classes
           Product: Log4j
           Version: 1.2
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: major
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: davidj@mocapay.com


There is a bug in the Spring 2.5 MailSendException class where it throws an exception on calls to 
getMessage and printStackTrace (see SPR-4138 in Spring's bug DB). This spring bug exposed what I 
consider a problem with log4j.

Partial stack trace:

Caused by: java.lang.NullPointerException
	at org.springframework.mail.MailSendException.printStackTrace(MailSendException.java:149)
	at org.apache.log4j.spi.ThrowableInformation.getThrowableStrRep(ThrowableInformation.java:59)

I would expect log4j to use try/catch blocks around any calls it makes to Exception classes so that a 
consumer of the logging library can be confident that a call to a log(...) method will never throw an 
exception, even if a buggy exception reference is passed in. I'd rather get no message or stack trace in 
the output than have log4j pass the exception to my application. If this isn't addressed in log4j then I'll 
have to create a wrapper that around it that does trap any exceptions.

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

---------------------------------------------------------------------
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 44038] - log4j is susceptible to exceptions thrown by Exception classes

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44038>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44038


daniel.armbrust.list@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |critical




------- Additional Comments From daniel.armbrust.list@gmail.com  2007-12-19 14:31 -------
Yes, this seems like a really bad idea.  I ran into this too.  The telnet
appender has issues that can cause a null pointer (bug 44109) and those blow
right back out into calling code too.  

A call to "log" shouldn't ever throw an exception back - it should trap it and
report is somewhere, perhaps to the loggers that are working, or at a minimum to
the console.  

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

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