Bug 46388 - Layout ignoresThrowable Documentation mismatch implementation
Layout ignoresThrowable Documentation mismatch implementation
Status: RESOLVED FIXED
Product: Log4j
Classification: Unclassified
Component: Appender
1.2
All All
: P2 normal
: ---
Assigned To: log4j-dev
:
Depends on:
Blocks:
  Show dependency tree
 
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.