[logback-dev] [JIRA] Created: (LBCORE-179) conversion word %ex length handling is off by one
Michael Osipov (JIRA)
noreply-jira at qos.ch
Mon Nov 8 12:30:51 CET 2010
conversion word %ex length handling is off by one
-------------------------------------------------
Key: LBCORE-179
URL: http://jira.qos.ch/browse/LBCORE-179
Project: logback-core
Issue Type: Bug
Components: Pattern
Affects Versions: 0.9.26
Reporter: Michael Osipov
Assignee: Logback dev list
The %ex and %xEx define a stack trace length. The integer spec is somewhat faulty and misleading. First of all this is a stack trace depth imho and not length. Anyway, I was poking around with the SMTPAppender and wanted to include the sole exception message into the subject. The outcome was:
1. The docs do not define a valid interval for the integer value. You can only deduce from logic.
2. I defined %ex{short} and it included 2 lines of the stack trace.
3. I defined %ex{2} and it included 3 lines of the stack trace.
4. I defined %ex{0} and it included 1 line of the stack trace.
5. Defining any negative number omits the stack trace. But it does not make sense at all to have a negative stack trace depth.
I checked also the source of the [https://github.com/ceki/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableProxyConverter.java converter], the lines 54 and 58 cause the problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the logback-dev
mailing list