It is not working for me as well.
I am making use of a customized SMTPAppender class for my application
purposes. It is not even entering this class. If I remove async way, it is
working fine.
With async enabled, if I give the mailhost wrongly, no exception is thrown
back.
Please help
Here is my log4j xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!--
| For more configuration infromation and examples see the Jakarta Log4j
| owebsite: http://jakarta.apache.org/log4j
-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true">
<!-- Buffer events and log them asynchronously -->
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="MAIL" />
</appender>
<!-- EMail events to an administrator -->
<appender name="MAIL"
class="com.mycomp.notification.log4j.SMTPAppenderTimeout">
<layout class="org.apache.log4j.HTMLLayout" />
</appender>
<root>
<priority value ="FATAL" />
<appender-ref ref="ASYNC" />
</root>
</log4j:configuration>
Thanks,
Radhika.
alkuin wrote:
>
>
> amitshinde wrote:
>>
>> Did anyone else notice this? Can we send emails asynchronously at all?
>>
>
> I am using log4j-1.2.15 in Tomcat 5.5. Sending emails asynchronously seems
> to work with an
> <appender-ref ref="async"/> in the root and an <appender-ref ref="mail"/>
> in the "async" appender. "mail" is the name of the SMTPAppender.
>
> To check if email is sent asynchronously, I provoked an error by giving a
> wrong SMTPPassword in the configuration. In Tomcat's log directory, the
> stdout_20090203.log then contained this stack trace:
>
> javax.mail.AuthenticationFailedException
> at javax.mail.Service.connect(Service.java:306)
> at javax.mail.Service.connect(Service.java:156)
> at javax.mail.Service.connect(Service.java:105)
> at javax.mail.Transport.send0(Transport.java:168)
> at javax.mail.Transport.send(Transport.java:98)
> at org.apache.log4j.net.SMTPAppender.sendBuffer(SMTPAppender.java:330)
> at org.apache.log4j.net.SMTPAppender.append(SMTPAppender.java:215)
> at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
> at
> org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
> at org.apache.log4j.AsyncAppender$Dispatcher.run(AsyncAppender.java:583)
> at java.lang.Thread.run(Unknown Source)
>
>
> Without the AsyncAppender, the stack trace was like this:
> javax.mail.AuthenticationFailedException
> at javax.mail.Service.connect(Service.java:306)
> at javax.mail.Service.connect(Service.java:156)
> at javax.mail.Service.connect(Service.java:105)
> at javax.mail.Transport.send0(Transport.java:168)
> at javax.mail.Transport.send(Transport.java:98)
> at org.apache.log4j.net.SMTPAppender.sendBuffer(SMTPAppender.java:330)
> at org.apache.log4j.net.SMTPAppender.append(SMTPAppender.java:215)
> at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
> at
> org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
> at org.apache.log4j.Category.callAppenders(Category.java:206)
> at org.apache.log4j.Category.forcedLog(Category.java:391)
> at org.apache.log4j.Category.error(Category.java:322)
> at org.apache.jsp.errorhandler_jsp._jspService(errorhandler_jsp.java:86)
> (truncated; many more lines following)
>
>
>
>
--
View this message in context:
http://old.nabble.com/SMTPAppender-not-asynchronous-using-AsyncAppender-tp21308582p32643700.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]