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 Endre Midtgård Meckelborg <en...@gmail.com> on 2006/03/14 08:33:46 UTC

Safe mail sending that doesn't fill up the mailbox

Hi!

I'm pretty new to JBoss and the logging used there (log4j).  I don't 
know if this question is best suited for the JBoss-list or the 
log4j-list, but I start here :)

I see that JBoss default has a default appender that is commented out. 
This is just what I need, I want an email each time an error occurs in 
the server. Heres the appender:

<!-- EMail events to an administrator
<appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
   <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
   <param name="Threshold" value="ERROR"/>
   <param name="To" value="admin@myhost.domain.com"/>
   <param name="From" value="nobody@myhost.domain.com"/>
   <param name="Subject" value="JBoss Sever Errors"/>
   <param name="SMTPHost" value="localhost"/>
   <param name="BufferSize" value="10"/>
   <layout class="org.apache.log4j.PatternLayout">
     <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
   </layout>
</appender>
-->

But I'm a bit afraid. What will happen if something really serious 
happens, ie that something loops and starts to fail all the time? Will 
this fill up the mailbox or may be take down the whole mail system?

What I really want is a safety net that avoids sending more that one 
mail each N minute, or something like that.

Is there an easy way to get this or do I have to write something myself?
Thanks for tips :)

-- 
Regards...
Endre Midtgård Meckelborg

MSN: endremr@gmail.com  AIM: endremr  Skype: endremr

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