logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Virajith KHP" <khp.viraj...@gmail.com>
Subject Problem in using SMTPAppender with gmail
Date Fri, 19 Sep 2008 11:30:59 GMT
 Hello,

I'm using Log4j as the logging framework and I've configured it to send an
email with log information when a log with ERROR/FATAL logging level is
created.My Log4j configuration is as follows.


    code:


     <appender  name="smtp_ErrorFatal"
class="org.apache.log4j.net.SMTPAppender" >
            <param name="SMTPHost" value="smtp.gmail.com" />
            <param name="SMTPUsername" value="[username]" />
            <param name="SMTPPassword" value="[password]" />
            <param name="From" value="[valid email]" />
            <param name="To" value="[valid email]" />
            <param name="Cc" value="[valid email]" />
            <param name="Subject" value="[LOG] ..." />
            <param name="BufferSize" value="512" />
            <param name="threshold" value="error" />
            <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%d{DATE} | %-5p |
%X{userid} | %C | %M | %t | %L | %m%n" />
            </layout>
        </appender>



But whenever a log with ERROR/FATAL logging level is created, Log4j tries to
send the email but terminates it with the following exception..

    code:


    log4j:ERROR Error occured while sending e-mail notification.
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a
STARTTLS command first. a14sm1453665tia.0

            at
com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
            at
com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
            at
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
            at javax.mail.Transport.send0(Transport.java:169)
            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:305)
            at
miracle.server.presentation.customcomponents.SplashFrame.retrieveSplashImage(SplashFrame.java:53)
            at
miracle.server.presentation.customcomponents.SplashFrame.<init>(SplashFrame.java:29)
            at
miracle.server.logic.common.AppManager$1.run(AppManager.java:41)
            at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)



Can anybody point out where the problem is?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message