logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Massimo Quagliani" <massimo.quagli...@ericsson.com>
Subject RE: SMTPAppender
Date Thu, 04 Dec 2008 18:34:33 GMT
I tried:

telnet mail.libero.it 25
Trying 212.52.84.54...
telnet: Unable to connect to remote host: Connection timed out 

But I have a stupid question, using telnet my client is expected to find a telnet server on
the port 25, while there should be an smtp server.
Am I wrong?

/MAx

-----Original Message-----
From: Bender Heri [mailto:HBender@Ergonomics.ch] 
Sent: giovedì 4 dicembre 2008 19.11
To: Log4J Users List
Subject: AW: SMTPAppender

Try a standalone tool in order to open this socket.  E.g. castalia socktest (free download),
or even telnet in your command prompt:

Telnet host port

heri

-----Ursprüngliche Nachricht-----
Von: Massimo Quagliani [mailto:massimo.quagliani@ericsson.com]
Gesendet: Donnerstag, 4. Dezember 2008 18:02
An: Log4J Users List
Betreff: RE: SMTPAppender

Please,
could you explain in detail what you would do in this situation? 
I didn't figure out your suggestion.

/Max

-----Original Message-----
From: Joe White [mailto:jwhite@asidejob.com]
Sent: giovedì 4 dicembre 2008 17.45
To: log4j-user@logging.apache.org
Subject: RE: SMTPAppender



   The error is clear in the stacktrace.

        java.net.ConnectException: Connection timed out: connect
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)

   I do not think it's log4j related..

   Can you make the connection on your box via telnet or some other type of email program
?

   Quoting Massimo Quagliani <massimo.quagliani@ericsson.com>:

> Thanks,
>
> But I changed my log4j.properties file using another SMTP host, which, 
> according to this link
> http://www.velociraptus.com/internet/articoli_d.php?particoloID=27
> uses port 25 for SMTP (it is in italian but in the table it is clear 
> the port is 25).
> The error is still there...
> Please help!!
>
> /Massimo
>
>
> # Email appender
> log4j.appender.email=org.apache.log4j.net.SMTPAppender
> log4j.appender.email.BufferSize=25
> log4j.appender.email.SMTPHost=mail.libero.it
> log4j.appender.email.SMTPUsername=<valid_username>
> log4j.appender.email.SMTPPassword=<valid_password>
> log4j.appender.email.From=xxxx@libero.it
> log4j.appender.email.To=xxxx@libero.it
> log4j.appender.email.Subject=Error
> log4j.appender.email.layout=org.apache.log4j.PatternLayout
> log4j.appender.email.layout.ConversionPattern=    %d{DATE} %-5p %m
> -  %c{3} [%t] [%r ms]%n%n
> log4j.appender.email.threshold=ERROR
>
>
> The stack trace is the same...
>
> 2008-12-04 09:28:17,515 ERROR [http-8080-2]                : This is a try!
> log4j:ERROR Error occured while sending e-mail notification.
> javax.mail.MessagingException: Could not connect to SMTP host: 
> mail.libero.it, port: 25;
>    nested exception is:
>         java.net.ConnectException: Connection timed out: connect
>         at
> com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
>         at
> com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412
> )
>         at javax.mail.Service.connect(Service.java:310)
>         at javax.mail.Service.connect(Service.java:169)
>         at javax.mail.Service.connect(Service.java:118)
>         at javax.mail.Transport.send0(Transport.java:188)
>         at javax.mail.Transport.send(Transport.java:118)
>         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 servlet.Log4jServlet.doGet(Log4jServlet.java:80)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> cationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lterChain.java:206)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
> lve.java:233)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
> lve.java:175)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
> va:128)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
> va:102)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
> e.java:109)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :286)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 844)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
> s(Http11Protocol.java:583)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447
> )
>         at java.lang.Thread.run(Unknown Source) Caused by: 
> java.net.ConnectException: Connection timed out: connect
>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>         at java.net.PlainSocketImpl.doConnect(Unknown Source)
>         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
>         at java.net.PlainSocketImpl.connect(Unknown Source)
>         at java.net.SocksSocketImpl.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at
> com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233)
>         at 
> com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
>         at
> com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
>         ... 28 more
>
>
> -----Original Message-----
> From: Joe White [mailto:jwhite@asidejob.com]
> Sent: mercoledì 3 dicembre 2008 20.26
> To: log4j-user@logging.apache.org
> Subject: Re: SMTPAppender
>
>
>
>     Gmail SMTP server requires TLS and it does not use the default 
> port of 25.
>
>     According to this link:
>
>     http://mail.google.com/support/bin/answer.py?hl=en&answer=13287
>
>     You must use port 456 or 587 for SMTP.
>
>     However, port is not an option YET in the latest release. (unless
> 1.2.16 has been release)
>
>     Here is what Curt replied with.
>
>     "
>
>     log4j.appender.YOURAPPENDERNAME.smtpUsername=USERNAME
> log4j.appender.YOURAPPENDERNAME.smtpPassword=PASSWORD
> log4j.appender.YOURAPPENDERNAME.smtpPort=PORT
>
> Port is in the current source, but not in the last release.  We need  
> to cut a log4j
> 1.2.16 soon.
>
>     "
>
>     Quoting Massimo Quagliani <massimo.quagliani@ericsson.com>:
>
>>> Hi,
>>> I have the following problem using SMTPAppender, Actually the email 
>>> does not arrive to the mailbox and I got the following error:
>>>
>>> log4j:ERROR Error occured while sending e-mail notification.
>>> javax.mail.MessagingException: Could not connect to SMTP host:
>>> smtp.gmail.com, port: 25;
>>>    nested exception is:
>>>         java.net.ConnectException: Connection timed out: connect
>>>
>>> The log4j.properties contains:
>>>
>>> log4j.rootCategory=info, dest1, dest3, email
>>>
>>> # Email appender
>>> log4j.appender.email=org.apache.log4j.net.SMTPAppender
>>> log4j.appender.email.BufferSize=25
>>> log4j.appender.email.SMTPHost=smtp.gmail.com
>>> log4j.appender.email.SMTPUsername=<valid_username>
>>> log4j.appender.email.SMTPPassword=<valid_password>
>>> log4j.appender.email.From=xxxx@gmail.com
>>> log4j.appender.email.To=xxxx@gmail.com
>>> log4j.appender.email.Subject=Error
>>> log4j.appender.email.layout=org.apache.log4j.PatternLayout
>>> log4j.appender.email.layout.ConversionPattern=    %d{DATE} %-5p %m - 
>>> %c{3} [%t] [%r ms]%n%n log4j.appender.email.threshold=ERROR
>>>
>>>
>>> I am using eclipse on my PC for this try.
>>> Please could you help me to find the solution to this nasty problem?
>>> Thanks in advance, below is the complete stack trace
>>>
>>>
>>> 2008-12-03 18:23:38,296 ERROR [http-8080-1]                : This is

>>> a try!
>>> log4j:ERROR Error occured while sending e-mail notification.
>>> javax.mail.MessagingException: Could not connect to SMTP host:
>>> smtp.gmail.com, port: 25;
>>>    nested exception is:
>>>         java.net.ConnectException: Connection timed out: connect
>>>         at
>>> com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
>>>         at
>>> com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:4
>>> 1
>>> 2
>>> )
>>>         at javax.mail.Service.connect(Service.java:310)
>>>         at javax.mail.Service.connect(Service.java:169)
>>>         at javax.mail.Service.connect(Service.java:118)
>>>         at javax.mail.Transport.send0(Transport.java:188)
>>>         at javax.mail.Transport.send(Transport.java:118)
>>>         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.appendLoopOnAppender
>>> s
>>> (
>>> 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 servlet.Log4jServlet.doGet(Log4jServlet.java:80)
>>>         at
>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>         at
>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>         at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
>>> l
>>> i
>>> cationFilterChain.java:290)
>>>         at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
>>> F
>>> i
>>> lterChain.java:206)
>>>         at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
>>> V
>>> a
>>> lve.java:233)
>>>         at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContext
>>> V
>>> a
>>> lve.java:175)
>>>         at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
>>> j
>>> a
>>> va:128)
>>>         at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
>>> j
>>> a
>>> va:102)
>>>         at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
>>> l
>>> v
>>> e.java:109)
>>>         at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
>>> v
>>> a
>>> :286)
>>>         at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
>>> 844)
>>>         at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proc
>>> e
>>> s
>>> s(Http11Protocol.java:583)
>>>         at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:4
>>> 4
>>> 7
>>> )
>>>         at java.lang.Thread.run(Unknown Source) Caused by:
>>> java.net.ConnectException: Connection timed out: connect
>>>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>>>         at java.net.PlainSocketImpl.doConnect(Unknown Source)
>>>         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
>>>         at java.net.PlainSocketImpl.connect(Unknown Source)
>>>         at java.net.SocksSocketImpl.connect(Unknown Source)
>>>         at java.net.Socket.connect(Unknown Source)
>>>         at java.net.Socket.connect(Unknown Source)
>>>         at
>>> com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233)
>>>         at
>>> com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
>>>         at
>>> com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
>>>         ... 28 more
>>
>
>     --
> "We are what we repeatedly do. Excellence, then, is not an act, but a habit."
> Aristotle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

   --
"We are what we repeatedly do. Excellence, then, is not an act, but a habit."
Aristotle

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



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


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


Mime
View raw message