log4j

S

sr

Hallo,

how can i use log4j SMTPAppender to send eMail for different eMail
addresses.

Is it possible to use something like a category?



Level ERROR with category DEP_1 - email for (e-mail address removed)
Level ERROR with category DEP_2 - email for (e-mail address removed)

Example:
<appender name="SMTP_ERROR" class="org.apache.log4j.net.SMTPAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Threshold" value="ERROR"/>
<param name="To" value="(e-mail address removed)"/>
<param name="From" value="(e-mail address removed)"/>
<param name "category????????" value = "DEP_1"> ???????????????
<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>





Thank a lot!!!

Staszek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top