Bug 46388 - Layout ignoresThrowable Documentation mismatch implementation
Summary: Layout ignoresThrowable Documentation mismatch implementation
Status: RESOLVED FIXED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-12 08:10 UTC by Felipe
Modified: 2009-01-08 09:24 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe 2008-12-12 08:10:37 UTC
According to the documentation [1] the method ignoresThrowable() from org.apache.log4j.Layout class should force the appender to not print the stacktrace if the method return code is true. 

But in org.apache.log4j.net.SyslogAppender the behavior is just the oposite. It may happen with other appenders.

The problem appear to be in the line 332: if (layout.ignoresThrowable()) {

Best regards,
Felipe Pinto
Comment 1 Curt Arnold 2009-01-08 09:24:53 UTC
The reference for the potentially misleading documentation was not provided, but I elaborated the Layout.ignoresThrowable javadoc.  

The SyslogAppender is properly interpreting the property.  If Layout.ignoresThrowable is false, then the layout handles the throwable and the appender should not do anything with the throwable.  If Layout.ignoresThrowable is true, then the layout does not do anything with the throwable and the appender is responsible for formatting the throwable. 

Committed rev 732766.