I am using: - Sun J2SE 1.3.1.06 - Jakarta Log4j 1.2.8 - SMTPAppender with PatternLayout
When the SMTPAppender sends an email message, the stack trace is formatted differently than I would expect. The entire stack trace is concatenated onto a single line. I was expecting the stack trace to be on multiple lines. I studied the source code for SMTPAppender. This is what I found: // // source file: src/java/org/apache/log4j/net/SMTPAppender.java // protected void sendBuffer() { // ... if(layout.ignoresThrowable()) { String[] s = event.getThrowableStrRep(); if (s != null) { for(int j = 0; j < s.length; j++) { sbuf.append(s[j]); } } } // ... } You'll notice that the inner for loop does not append newline characters. It would be helpful if the loop appended a new line character: for(int j = 0; j < s.length; j++) { sbuf.append(s[j]); sbuf.append("\n"); } Cheers, -Sean --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]