Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
None
Description
In logback 1.0.4 Syslogappender got the <StackTracePattern> property, which we have been using to pass stacktraces to our logserver with a custom prefix for each line.
This has worked, but we've had a few problems that I finally had some time to look into. My goal has been to achieve a logging behaviour similar to what RollingFileAppender produces.
I've identified a type of line that does not get sent to syslog. When a stacktrace is logged, RollingFileAppender will log:
-the log line
-a special line containing IThrowableProxy.getClassName() + IThrowableProxy.getMessage()
-the lines of the stacktrace
if it is a nested stacktrace, RollingFileAppender will then proceed to log:
-a special line containing "Caused by: "+IThrowableProxy.getClassName() + IThrowableProxy.getMessage()
-the lines of the nested stacktrace
Here is an example of a stacktrace produced by RollingFileAppender:
18.09.2012 18:36:19.312 [INFO] [n.v.w.t.WSTesterServlet] [XXXXIMB.1347986179274.0]: SystemException caused by nullpointer:
no.vps.exceptions.SystemException: COM_INVALID_CHAR
at no.vps.ws.tester.WSTesterServlet.handleRequest(WSTesterServlet.java:79) [classes/:na]
at no.vps.ws.tester.WSTesterServlet.doGet(WSTesterServlet.java:54) [classes/:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) [javax.j2ee.servlet.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) [javax.j2ee.servlet.jar:na]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
[cut...]
[com.ibm.ws.runtime.jar:na]
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604) [com.ibm.ws.runtime.jar:na]
Caused by: java.lang.NullPointerException: null
at no.vps.ws.tester.WSTesterServlet.handleRequest(WSTesterServlet.java:77) [classes/:na]
... 29 common frames omitted
In Syslogappender, the special lines do not get sent to syslog, at all. The lines are:
no.vps.exceptions.SystemException: COM_INVALID_CHAR
Caused by: java.lang.NullPointerException: null
As a result
-the exception message is not logged
-nested stacktraces are presented as one long stacktrace, making it very difficult to figure out where one stacktrace ends and the next ensted stacktrace begins.
Attachments
Issue Links
- is duplicated by
-
LOGBACK-411 Missing logging of Throwable in SyslogAppender
- Resolved