You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by de...@stefanclos.de on 2013/07/31 11:53:21 UTC
smtp appender - no email send
Hello,
i configured an smtp appender to get log messages by email.
Console and File Appenders work well, but the smtp appender seems not
to do anything.
Any ideas ? How can i debug this, i didn´t get any error messages from log4j ?
LOG4J Configuration:
log4j.appender.email=org.apache.log4j.net.SMTPAppender
log4j.appender.email.Threshold=DEBUG
log4j.appender.EMAIL.SMTPDebug=true
log4j.appender.email.SMTPHost=127.0.0.1
log4j.appender.email.From=stefan.clos@helaba-invest.de
log4j.appender.email.To=stefan.clos@helaba-invest.de
log4j.appender.email.Subject=IBOXX_KURSE_CHECK_ERROR
log4j.appender.email.BufferSize=512
log4j.appender.email.layout=org.apache.log4j.PatternLayout
log4j.appender.email.layout.ConversionPattern=%m
cheers
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
AW: smtp appender - no email send
Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
If you have somewhere a real SMTP host, the one you send your
personal outgoing e-mails to; why not use that smtp host to
test your smtp sender. use that host once for a test and define
(not to forget) some user credentials too.
Then generate a log.debug messge and see what happens;
what I do not understand and cannot tell you is:
what is the trigger point that the smpt appender delivers the
cached message to the smtp host for further transmission to
the final e-mail receiver.
Is every event sent as e-mail?
Is a bunch of events sent as e-mail?
how do you adjust how many events are cached unless a send takes place?
I made Jenkins work for me that way, sending build events the same way as
outlook express does it to my smtp host at the internet service provider.
I like it and it works for me.
Josef
-----Ursprüngliche Nachricht-----
Von: dev2013@stefanclos.de [mailto:dev2013@stefanclos.de]
Gesendet: Mittwoch, 31. Juli 2013 12:58
An: Log4J Users List
Betreff: Re: smtp appender - no email send
Hello Gokul,
thanks, i took care about this.
There is an error event, which is logged by console and file appender.
[2013-07-31 10:36:28,923] ERROR [FtpClient.connect]connect: Address is
invalid on local machine, or port is not valid on remote machine
(FtpClient.java#connect:65)
cheers
Stefan
Zitat von gokulvsmail <go...@gmail.com>:
> By default behavior log4j will only send the log messages when a ERROR
> event is happening.
> For testing try by create some error loggs.
>
> gokul
>
> On Wednesday 31 July 2013 03:23 PM, dev2013@stefanclos.de wrote:
>> Hello,
>>
>> i configured an smtp appender to get log messages by email.
>> Console and File Appenders work well, but the smtp appender seems not
>> to do anything.
>>
>> Any ideas ? How can i debug this, i didn´t get any error messages
>> from log4j ?
>>
>> LOG4J Configuration:
>>
>> log4j.appender.email=org.apache.log4j.net.SMTPAppender
>> log4j.appender.email.Threshold=DEBUG
>> log4j.appender.EMAIL.SMTPDebug=true
>> log4j.appender.email.SMTPHost=127.0.0.1
>> log4j.appender.email.From=stefan.clos@helaba-invest.de
>> log4j.appender.email.To=stefan.clos@helaba-invest.de
>> log4j.appender.email.Subject=IBOXX_KURSE_CHECK_ERROR
>> log4j.appender.email.BufferSize=512
>> log4j.appender.email.layout=org.apache.log4j.PatternLayout
>> log4j.appender.email.layout.ConversionPattern=%m
>>
>>
>> cheers
>> Stefan
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
Re: smtp appender - no email send
Posted by de...@stefanclos.de.
Yipiee, have solved it :)
Needed following definition:
log4j.rootCategory=DEBUG, Console, R, EMAIL
I´ve checked active Loggers with this code, Emails wasn´t in the list:
Logger l = logger.getRootLogger();
Enumeration e = l.getAllAppenders();
while(e.hasMoreElements()) {
Appender a = (Appender)e.nextElement();
logger.debug("Appender: " + a);
}
Zitat von dev2013@stefanclos.de:
> Hello Gokul,
>
> thanks, i took care about this.
> There is an error event, which is logged by console and file appender.
>
> [2013-07-31 10:36:28,923] ERROR [FtpClient.connect]connect: Address
> is invalid on local machine, or port is not valid on remote machine
>
> (FtpClient.java#connect:65)
>
>
>
> cheers
> Stefan
>
>
> Zitat von gokulvsmail <go...@gmail.com>:
>
>> By default behavior log4j will only send the log messages when a
>> ERROR event is happening.
>> For testing try by create some error loggs.
>>
>> gokul
>>
>> On Wednesday 31 July 2013 03:23 PM, dev2013@stefanclos.de wrote:
>>> Hello,
>>>
>>> i configured an smtp appender to get log messages by email.
>>> Console and File Appenders work well, but the smtp appender seems
>>> not to do anything.
>>>
>>> Any ideas ? How can i debug this, i didn´t get any error messages
>>> from log4j ?
>>>
>>> LOG4J Configuration:
>>>
>>> log4j.appender.email=org.apache.log4j.net.SMTPAppender
>>> log4j.appender.email.Threshold=DEBUG
>>> log4j.appender.EMAIL.SMTPDebug=true
>>> log4j.appender.email.SMTPHost=127.0.0.1
>>> log4j.appender.email.From=stefan.clos@helaba-invest.de
>>> log4j.appender.email.To=stefan.clos@helaba-invest.de
>>> log4j.appender.email.Subject=IBOXX_KURSE_CHECK_ERROR
>>> log4j.appender.email.BufferSize=512
>>> log4j.appender.email.layout=org.apache.log4j.PatternLayout
>>> log4j.appender.email.layout.ConversionPattern=%m
>>>
>>>
>>> cheers
>>> Stefan
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: smtp appender - no email send
Posted by de...@stefanclos.de.
Hello Gokul,
thanks, i took care about this.
There is an error event, which is logged by console and file appender.
[2013-07-31 10:36:28,923] ERROR [FtpClient.connect]connect: Address is
invalid on local machine, or port is not valid on remote machine
(FtpClient.java#connect:65)
cheers
Stefan
Zitat von gokulvsmail <go...@gmail.com>:
> By default behavior log4j will only send the log messages when a
> ERROR event is happening.
> For testing try by create some error loggs.
>
> gokul
>
> On Wednesday 31 July 2013 03:23 PM, dev2013@stefanclos.de wrote:
>> Hello,
>>
>> i configured an smtp appender to get log messages by email.
>> Console and File Appenders work well, but the smtp appender seems
>> not to do anything.
>>
>> Any ideas ? How can i debug this, i didn´t get any error messages
>> from log4j ?
>>
>> LOG4J Configuration:
>>
>> log4j.appender.email=org.apache.log4j.net.SMTPAppender
>> log4j.appender.email.Threshold=DEBUG
>> log4j.appender.EMAIL.SMTPDebug=true
>> log4j.appender.email.SMTPHost=127.0.0.1
>> log4j.appender.email.From=stefan.clos@helaba-invest.de
>> log4j.appender.email.To=stefan.clos@helaba-invest.de
>> log4j.appender.email.Subject=IBOXX_KURSE_CHECK_ERROR
>> log4j.appender.email.BufferSize=512
>> log4j.appender.email.layout=org.apache.log4j.PatternLayout
>> log4j.appender.email.layout.ConversionPattern=%m
>>
>>
>> cheers
>> Stefan
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
Re: smtp appender - no email send
Posted by gokulvsmail <go...@gmail.com>.
By default behavior log4j will only send the log messages when a ERROR
event is happening.
For testing try by create some error loggs.
gokul
On Wednesday 31 July 2013 03:23 PM, dev2013@stefanclos.de wrote:
> Hello,
>
> i configured an smtp appender to get log messages by email.
> Console and File Appenders work well, but the smtp appender seems not
> to do anything.
>
> Any ideas ? How can i debug this, i didn´t get any error messages from
> log4j ?
>
> LOG4J Configuration:
>
> log4j.appender.email=org.apache.log4j.net.SMTPAppender
> log4j.appender.email.Threshold=DEBUG
> log4j.appender.EMAIL.SMTPDebug=true
> log4j.appender.email.SMTPHost=127.0.0.1
> log4j.appender.email.From=stefan.clos@helaba-invest.de
> log4j.appender.email.To=stefan.clos@helaba-invest.de
> log4j.appender.email.Subject=IBOXX_KURSE_CHECK_ERROR
> log4j.appender.email.BufferSize=512
> log4j.appender.email.layout=org.apache.log4j.PatternLayout
> log4j.appender.email.layout.ConversionPattern=%m
>
>
> cheers
> Stefan
>
>
>
> ---------------------------------------------------------------------
> 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