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 Je...@nlgroup.ca on 2003/09/27 20:03:32 UTC
SMTPAppender and BufferSize.
Greetings:
I have what I hope to be a simple question.
We are using the log4j implementation in JBoss 3.0.4.
When I activate the SMTP Appender for ERROR level to send me an email
for any exceptions and stack traces,
I was under the impression that I could buffer events and have the
email contain more than one log entry in the email body.
I get an email for every single log entry. Am I way off base?
I have simply started using the commented config in the log4j.xml supplied
by Jboss.
<appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
<param name="Threshold" value="ERROR"/>
<param name="To" value="xx@xx"/>
<param name="From" value="xx@x"/>
<param name="Subject" value="JBoss Sever Exception"/>
<param name="SMTPHost" value="xxx.xxx.x.xx"/>
<param name="BufferSize" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
</layout>
</appender>
Any help would be appreciated
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: SMTPAppender and BufferSize.
Posted by Paul Smith <pa...@lawlex.com.au>.
On Sun, 2003-09-28 at 04:03, Jeff_Mychasiw@nlgroup.ca wrote:
> Greetings:
> I have what I hope to be a simple question.
>
> We are using the log4j implementation in JBoss 3.0.4.
>
> When I activate the SMTP Appender for ERROR level to send me an email
> for any exceptions and stack traces,
> I was under the impression that I could buffer events and have the
> email contain more than one log entry in the email body.
>
> I get an email for every single log entry. Am I way off base?
There are 2 important properties for SMTPAppender, the EvaluatorClass,
and the Threshold. You have set the Threshold to Error, and the
appender is using the default EvaluatorClass which matches ERROR.
Basically it's the EvaluatorClass property that determines WHEN to send
the email, and uses the Buffer of events received since the last
Triggering event. Since you have the threshold set to ERROR, the
appender is only letting that 1 event get in the Buffer.
Try setting the Threshold to INFO, and you should find the email you
receive should contain the last X INFO-and-above events plus the ERROR
event that triggered it.
> I have simply started using the commented config in the log4j.xml supplied
> by Jboss.
>
> <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
> <param name="Threshold" value="ERROR"/>
> <param name="To" value="xx@xx"/>
> <param name="From" value="xx@x"/>
> <param name="Subject" value="JBoss Sever Exception"/>
> <param name="SMTPHost" value="xxx.xxx.x.xx"/>
> <param name="BufferSize" value="10"/>
> <layout class="org.apache.log4j.PatternLayout">
> <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
> </layout>
> </appender>
If the Error message itself contains everything you need to know, then
this is fine, but at any rate I think the BufferSize is misleading
here. Perhaps an issue to address with the JBoss team?
cheers,
Paul Smith
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org