<style>
/* Changing the layout to use less space for mobiles */
@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
#email-body { min-width: 30em !important; }
#email-page { padding: 8px !important; }
#email-banner { padding: 8px 8px 0 8px !important; }
#email-avatar { margin: 1px 8px 8px 0 !important; padding: 0 !important; }
#email-fields { padding: 0 8px 8px 8px !important; }
#email-gutter { width: 0 !important; }
}
</style>
<div id="email-body">
<table id="email-wrap" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#f0f0f0;color:#000000;width:100%;">
<tr valign="top">
<td id="email-page" style="padding:16px !important;">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border:1px solid #bbbbbb;color:#000000;width:100%;">
<tr valign="top">
<td bgcolor="#003366" style="background-color:#003366;color:#ffffff;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;line-height:1;"><img src="http://jira.qos.ch/s/en_USet69y6/731/19/_/jira-logo-scaled.png" alt="" style="vertical-align:top;" /></td>
</tr><tr valign="top">
<td id="email-banner" style="padding:32px 32px 0 32px;">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="width:100%;">
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;padding:0;">
<img id="email-avatar" src="http://jira.qos.ch/secure/useravatar?avatarId=10122" alt="" height="48" width="48" border="0" align="left" style="padding:0;margin: 0 16px 16px 0;" />
<div id="email-action" style="padding: 0 0 8px 0;font-size:12px;line-height:18px;">
<a class="user-hover" rel="ingebrigt" id="email_ingebrigt" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=ingebrigt" style="color:#326ca6;">Ingebrigt Berg</a>
created <img src="http://jira.qos.ch/images/icons/bug.gif" height="16" width="16" border="0" align="absmiddle" alt="Bug"> <a style='color:#326ca6;text-decoration:none;' href='http://jira.qos.ch/browse/LOGBACK-750'>LOGBACK-750</a>
</div>
<div id="email-summary" style="font-size:16px;line-height:20px;padding:2px 0 16px 0;">
<a style='color:#326ca6;text-decoration:none;' href='http://jira.qos.ch/browse/LOGBACK-750'><strong>syslogappender omits special lines in stacktraces</strong></a>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td id="email-fields" style="padding:0 32px 32px 32px;">
<table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
<tr valign="top">
<td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Issue Type:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<img src="http://jira.qos.ch/images/icons/bug.gif" height="16" width="16" border="0" align="absmiddle" alt="Bug"> Bug
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Assignee:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a class="user-hover" rel="logback-dev@qos.ch" id="email_logback-dev@qos.ch" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=logback-dev%40qos.ch" style="color:#326ca6;">Logback dev list</a>
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Created:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
19/Sep/12 11:28 AM
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Description:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
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.
<br/>
<br/>
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.
<br/>
<br/>
I've identified a type of line that does not get sent to syslog. When a stacktrace is logged, RollingFileAppender will log:
<br/>
-the log line
<br/>
-a special line containing IThrowableProxy.getClassName() + IThrowableProxy.getMessage()
<br/>
-the lines of the stacktrace
<br/>
if it is a nested stacktrace, RollingFileAppender will then proceed to log:
<br/>
-a special line containing "Caused by: "+IThrowableProxy.getClassName() + IThrowableProxy.getMessage()
<br/>
-the lines of the nested stacktrace
<br/>
<br/>
Here is an example of a stacktrace produced by RollingFileAppender:
<br/>
<br/>
18.09.2012 18:36:19.312 [INFO] [n.v.w.t.WSTesterServlet] [XXXXIMB.1347986179274.0]: SystemException caused by nullpointer:
<br/>
no.vps.exceptions.SystemException: COM_INVALID_CHAR
<br/>
at no.vps.ws.tester.WSTesterServlet.handleRequest(WSTesterServlet.java:79) [classes/:na]
<br/>
at no.vps.ws.tester.WSTesterServlet.doGet(WSTesterServlet.java:54) [classes/:na]
<br/>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) [javax.j2ee.servlet.jar:na]
<br/>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) [javax.j2ee.servlet.jar:na]
<br/>
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131) [com.ibm.ws.webcontainer.jar:na]
<br/>
at no.vps.ws.web.filter.MDCFilter.doFilter(MDCFilter.java:50) [VPS_WebServicesCommonFramework-1.6.0-logtest-SNAPSHOT.jar:1.6.0-logtest-SNAPSHOT]
<br/>
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186) [com.ibm.ws.webcontainer.jar:na]
<br/>
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452) [com.ibm.ws.runtime.jar:na]
<br/>
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511) [com.ibm.ws.runtime.jar:na]
<br/>
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305) [com.ibm.ws.runtime.jar:na]
<br/>
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276) [com.ibm.ws.runtime.jar:na]
<br/>
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) [na:CC70.CF [a0849.02]]
<br/>
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) [na:CC70.CF [a0849.02]]
<br/>
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) [com.ibm.ws.runtime.jar:na]
<br/>
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) [com.ibm.ws.runtime.jar:na]
<br/>
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205) [com.ibm.ws.runtime.jar:na]
<br/>
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604) [com.ibm.ws.runtime.jar:na]
<br/>
Caused by: java.lang.NullPointerException: null
<br/>
at no.vps.ws.tester.WSTesterServlet.handleRequest(WSTesterServlet.java:77) [classes/:na]
<br/>
... 29 common frames omitted
<br/>
<br/>
<br/>
<br/>
In Syslogappender, the special lines do not get sent to syslog, at all. The lines are:
<br/>
no.vps.exceptions.SystemException: COM_INVALID_CHAR
<br/>
Caused by: java.lang.NullPointerException: null
<br/>
<br/>
As a result
<br/>
-the exception message is not logged
<br/>
-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.
<br/>
<br/>
</td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Project:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a style="color:#326ca6;" href="http://jira.qos.ch/browse/LOGBACK">logback</a>
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Priority:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<img src="http://jira.qos.ch/images/icons/priority_minor.gif" height="16" width="16" border="0" align="absmiddle" alt="Minor"> Minor
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Reporter:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a class="user-hover" rel="ingebrigt" id="email_ingebrigt" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=ingebrigt" style="color:#326ca6;">Ingebrigt Berg</a>
</td>
</tr> </table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td><!-- End #email-page -->
</tr>
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:10px;line-height:14px;padding: 0 16px 16px 16px;text-align:center;">
This message is automatically generated by JIRA.<br />
If you think it was sent incorrectly, please contact your <a style='color:#326ca6;' href='http://jira.qos.ch/secure/ContactAdministrators!default.jspa'>JIRA administrators</a>.<br />
For more information on JIRA, see: <a style='color:#326ca6;' href='http://www.atlassian.com/software/jira'>http://www.atlassian.com/software/jira</a>
</td>
</tr>
</table><!-- End #email-wrap -->
</div><!-- End #email-body -->