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 Marc Guillemot <mg...@yahoo.fr> on 2004/06/16 15:41:10 UTC

How to use SMTPAppender for info messages

Hi,

I'd like to use a SMTPAppender to send info messages (these are not 
errors but informations about the lifecycle of the application).
I get only ERROR and FATAL messages sent although I set the threshold to 
INFO:

<appender name="mailLifecycle" class="org.apache.log4j.net.SMTPAppender">
   <param name="Threshold" value="INFO"/>
   <param name="From" value="server@test.com"/>
   <param name="To" value="test@test.com"/>
   <param name="SMTPHost" value="localhost"/>
   <param name="BufferSize" value="1"/>
   <param name="Subject" value="[dev] Application lifecyle"/>
   <layout class="org.apache.log4j.HTMLLayout"/>
</appender>

Is it possible to configure it from the log4j.xml or do I have to write 
my custom Appender?

Marc.


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


Re: How to use SMTPAppender for info messages

Posted by Marc Guillemot <mg...@yahoo.fr>.
This means that it's not possible just with the log4j.xml without custom 
code for initialization?

Marc.

Jen wrote:
> SMTPAppender has a EvaluatorClass param, you can
> define your own to include info.
> I think default is error and up.
> 
> --- Marc Guillemot <mg...@yahoo.fr> wrote:
> 
>>Hi,
>>
>>I'd like to use a SMTPAppender to send info messages
>>(these are not 
>>errors but informations about the lifecycle of the
>>application).
>>I get only ERROR and FATAL messages sent although I
>>set the threshold to 
>>INFO:
>>
>><appender name="mailLifecycle"
>>class="org.apache.log4j.net.SMTPAppender">
>>   <param name="Threshold" value="INFO"/>
>>   <param name="From" value="server@test.com"/>
>>   <param name="To" value="test@test.com"/>
>>   <param name="SMTPHost" value="localhost"/>
>>   <param name="BufferSize" value="1"/>
>>   <param name="Subject" value="[dev] Application
>>lifecyle"/>
>>   <layout class="org.apache.log4j.HTMLLayout"/>
>></appender>
>>
>>Is it possible to configure it from the log4j.xml or
>>do I have to write 
>>my custom Appender?
>>
>>Marc.
>>
>>
>>
> 
> ---------------------------------------------------------------------
> 
>>To unsubscribe, e-mail:
>>log4j-user-unsubscribe@logging.apache.org
>>For additional commands, e-mail:
>>log4j-user-help@logging.apache.org
>>
>>
> 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail


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


Re: How to use SMTPAppender for info messages

Posted by Jen <xh...@yahoo.com>.
SMTPAppender has a EvaluatorClass param, you can
define your own to include info.
I think default is error and up.

--- Marc Guillemot <mg...@yahoo.fr> wrote:
> Hi,
> 
> I'd like to use a SMTPAppender to send info messages
> (these are not 
> errors but informations about the lifecycle of the
> application).
> I get only ERROR and FATAL messages sent although I
> set the threshold to 
> INFO:
> 
> <appender name="mailLifecycle"
> class="org.apache.log4j.net.SMTPAppender">
>    <param name="Threshold" value="INFO"/>
>    <param name="From" value="server@test.com"/>
>    <param name="To" value="test@test.com"/>
>    <param name="SMTPHost" value="localhost"/>
>    <param name="BufferSize" value="1"/>
>    <param name="Subject" value="[dev] Application
> lifecyle"/>
>    <layout class="org.apache.log4j.HTMLLayout"/>
> </appender>
> 
> Is it possible to configure it from the log4j.xml or
> do I have to write 
> my custom Appender?
> 
> Marc.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

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