Ah-ha! Nope, didn't define a category for it. Silly old me!

I'm going to ask another pretty stupid question.
should I create my own category as you said or should I just add them to the root category like the following:


  <root>
     <appender-ref ref="CONSOLE"/>
     <appender-ref ref="FILE"/>
     <appender-ref ref="ASYNC"/>
     <appender-ref ref="SMTP"/>
  </root>

Is there any advantage to defining your own category?

thanks again,
Brian

From: Marek Lange <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] log4j SMTPAppender
Date: Tue, 16 Dec 2003 14:29:01 +0100

Brian Styles wrote:
However I don't even see it trying to send the emails. I just see the error statement.
Just to make sure I have the right idea, does this mean that every time i do a call such as
catch(SomeException se){
log.error("my error message", se)
}
Then this should cause an email to be sent. Is this correct?

yes: if the appender configuration is correct.


<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="[EMAIL PROTECTED]"/>
<param name="From" value="[EMAIL PROTECTED]"/>
<param name="Subject" value="JBoss Sever Errors"/>
<param name="SMTPHost" value="mysmtpserver.com"/>
<param name="BufferSize" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
</layout>
</appender>

Did you define a <Category> for it?


<category name="your.package.name">
   <priority value="ERROR" />
   <appender-ref ref="SMTP" />
</category>

This is the reference to your SMTP-Appender.

-marek



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to