You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2014/01/15 19:53:24 UTC

[jira] [Commented] (LOG4J2-502) HTMLLayout: adding locationInfo parameter leads to error

    [ https://issues.apache.org/jira/browse/LOG4J2-502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872418#comment-13872418 ] 

Gary Gregory commented on LOG4J2-502:
-------------------------------------

Can you please test with the trunk version of the code? You will have to check out trunk and build it locally.

I cannot duplicate this with the current unit tests: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java

If you can still reproduce this with the trunk code, then we need a better test!

Thank you,
Gary



> HTMLLayout: adding locationInfo parameter leads to error
> --------------------------------------------------------
>
>                 Key: LOG4J2-502
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-502
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Layouts
>    Affects Versions: 2.0-beta9
>            Reporter: Ilya Tepikin
>
> If I configure log4j2.xml like this:
> {code}
> <SMTP name="Mailer" suppressExceptions="false"
>               subject="${subject}" to="${receipients}" from="${from}"
>               smtpHost="${smtpHost}" smtpPort="${smtpPort}"
>               smtpProtocol="${smtpProtocol}" smtpUsername="${smtpUser}"
>               smtpPassword="${smtpPassword}" smtpDebug="false" bufferSize="10">
>             <HTMLLayout locationInfo="true" fontSize="small" />
>         </SMTP>
> {code}
> I'm getting NPE error during logging error in my application:
> {code}
> 2014-01-15 21:15:30,951 ERROR An exception occurred processing Appender Mailer org.apache.logging.log4j.LoggingException: Error occurred while sending email
> 	at org.apache.logging.log4j.core.net.SMTPManager.sendEvents(SMTPManager.java:159)
> 	at org.apache.logging.log4j.core.appender.SMTPAppender.append(SMTPAppender.java:172)
> 	at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:99)
> 	at org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.run(AsyncAppender.java:229)
> Caused by: java.lang.NullPointerException
> 	at org.apache.logging.log4j.core.layout.HTMLLayout.toSerializable(HTMLLayout.java:158)
> 	at org.apache.logging.log4j.core.layout.HTMLLayout.toSerializable(HTMLLayout.java:46)
> 	at org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:45)
> 	at org.apache.logging.log4j.core.net.SMTPManager.writeBuffer(SMTPManager.java:188)
> 	at org.apache.logging.log4j.core.net.SMTPManager.writeContent(SMTPManager.java:174)
> 	at org.apache.logging.log4j.core.net.SMTPManager.formatContentToBytes(SMTPManager.java:166)
> 	at org.apache.logging.log4j.core.net.SMTPManager.sendEvents(SMTPManager.java:141)
> 	... 3 more 
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org