[logback-user] SMTPAppender, HTMLLayout with text/plain
Filipe Sousa
natros at gmail.com
Tue May 8 12:49:47 CEST 2012
Hi.
For some reason I'm receiving email reports with mime type text/plain
and my email client shows all the html code. I'm attaching a report
sent by logback.
I'm using javax.mail 1.4.4 and this logback (1.0.3) configuration
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="5000">
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>../logs/sama.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logFile.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="mail" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>mail.ipb.pt</smtpHost>
<to>filipe at ipb.pt</to>
<from>noreply at ipb.pt</from>
<subject>[sama]: %logger{20} - %m</subject>
<layout class="ch.qos.logback.classic.html.HTMLLayout" />
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<logger name="org.eclipse.jetty" level="WARN" />
<logger name="org.apache.cxf" level="WARN"/>
<logger name="pt.ipb.sama" level="WARN" />
<root level="WARN">
<appender-ref ref="file" />
<appender-ref ref="mail"/>
</root>
</configuration>
Thanks
--
Filipe Sousa
-------------- next part --------------
X-Account-Key: account2
X-UIDL: 00007b9b4bc85fce
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:
Return-Path: <noreply at ipb.pt>
Delivered-To: filipe at ipb.pt
Received: from localhost (localhost [127.0.0.1])
by blade02.ccom.ipb.pt (Postfix) with ESMTP id 2FC1D2EA064
for <filipe at ipb.pt>; Tue, 8 May 2012 11:10:27 +0100 (WEST)
X-Virus-Scanned: amavisd-new at ipb.pt
Received: from blade02.ccom.ipb.pt ([127.0.0.1])
by localhost (blade02.ccom.ipb.pt [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id D9NQXjcJfrk7 for <filipe at ipb.pt>;
Tue, 8 May 2012 11:10:27 +0100 (WEST)
Received: from dell (dmz02.adm.ipb.pt [193.137.101.194])
by blade02.ccom.ipb.pt (Postfix) with ESMTP id 1A6112EA04D
for <filipe at ipb.pt>; Tue, 8 May 2012 11:10:27 +0100 (WEST)
Date: Tue, 8 May 2012 11:09:39 +0100 (WEST)
From: noreply at ipb.pt
To: filipe at ipb.pt
Message-ID: <1755352231.21336471779546.JavaMail.fsousa at dell>
Subject: [sama]: p.i.s.s.w.IPWebServiceSoapImpl - Erro ao invocar
getAllServicoByUtente
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_2_14214026.1336471779538"
------=_Part_2_14214026.1336471779538
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Logback Log Messages</title>
<style type="text/css">
table { margin-left: 2em; margin-right: 2em; border-left: 2px solid #AAA; }
TR.even { background: #FFFFFF; }
TR.odd { background: #EAEAEA; }
TR.warn TD.Level, TR.error TD.Level, TR.fatal TD.Level {font-weight: bold; color: #FF4040 }
TD { padding-right: 1ex; padding-left: 1ex; border-right: 2px solid #AAA; }
TD.Time, TD.Date { text-align: right; font-family: courier, monospace; font-size: smaller; }
TD.Thread { text-align: left; }
TD.Level { text-align: right; }
TD.Logger { text-align: left; }
TR.header { background: #596ED5; color: #FFF; font-weight: bold; font-size: larger; }
TD.Exception { background: #A2AEE8; font-family: courier, monospace;}
</style>
</head>
<body>
<hr/>
<p>Log session start time Tue May 08 11:09:26 WEST 2012</p><p></p>
<table cellspacing="0">
<tr class="header">
<td class="Date">Date</td>
<td class="Thread">Thread</td>
<td class="Level">Level</td>
<td class="Logger">Logger</td>
<td class="MDC">MDC</td>
<td class="Message">Message</td>
</tr>
<tr class="warn even">
<td class="Date">2012-05-08 11:07:07,300</td>
<td class="Thread">qtp239887136-27</td>
<td class="Level">WARN</td>
<td class="Logger">org.apache.cxf.phase.PhaseInterceptorChain</td>
<td class="MDC"></td>
<td class="Message">Application {http://portal.apnor.pt/DataObjectModel}IPWebService#{http://portal.apnor.pt/DataObjectModel}GetAllServicoByUtente has thrown exception, unwinding now</td>
</tr>
<tr><td class="Exception" colspan="6">org.apache.cxf.interceptor.Fault: java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
<br /> at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
<br /> at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86)
<br /> at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
<br /> at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:64)
<br /> at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
<br /> at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
<br /> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
<br /> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
<br /> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
<br /> at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
<br /> at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
<br /> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
<br /> at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
<br /> at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
<br /> at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
<br /> at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)
<br /> at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:128)
<br /> at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
<br /> at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
<br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
<br /> at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
<br /> at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
<br /> at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
<br /> at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
<br /> at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
<br /> at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
<br /> at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
<br /> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1332)
<br /> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
<br /> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
<br /> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
<br /> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
<br /> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
<br /> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
<br /> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
<br /> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
<br /> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
<br /> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
<br /> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
<br /> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
<br /> at org.eclipse.jetty.server.Server.handle(Server.java:348)
<br /> at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
<br /> at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
<br /> at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
<br /> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
<br /> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
<br /> at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
<br /> at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
<br /> at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
<br /> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
<br /> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
<br /> at java.lang.Thread.run(Thread.java:662)
<br />Caused by: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
<br /> at pt.ipb.sama.server.ws.IPWebServiceSoapImpl.getAllServicoByUtente(IPWebServiceSoapImpl.java:370)
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
<br /> at java.lang.reflect.Method.invoke(Method.java:597)
<br /> at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
<br /> at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
<br /> ... 49 common frames omitted
<br />Caused by: java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
<br /> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
<br /> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
<br /> at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
<br /> at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
<br /> at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
<br /> at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
<br /> at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
<br /> at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
<br /> at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
<br /> at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
<br /> at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628)
<br /> at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493)
<br /> at com.jolbox.bonecp.PreparedStatementHandle.executeQuery(PreparedStatementHandle.java:172)
<br /> at pt.ipb.sama.server.ws.servicos.Servicos.getAllServicoByUtente(Servicos.java:47)
<br /> at pt.ipb.sama.server.ws.IPWebServiceSoapImpl.getAllServicoByUtente(IPWebServiceSoapImpl.java:367)
<br /> ... 55 common frames omitted
</td></tr>
<tr class="error odd">
<td class="Date">2012-05-08 11:09:26,546</td>
<td class="Thread">qtp239887136-25</td>
<td class="Level">ERROR</td>
<td class="Logger">pt.ipb.sama.server.ws.IPWebServiceSoapImpl</td>
<td class="MDC"></td>
<td class="Message">Erro ao invocar getAllServicoByUtente</td>
</tr>
</table>
</body></html>
------=_Part_2_14214026.1336471779538--
More information about the Logback-user
mailing list