<appender name="FILE" class="org.apache.log4j.XXXAppender">
<param name="Threshold" value="INFO"/> <!-- levels this appender emits
-->
...
</appender>

<appender name="SMTP" class="org.apache.log4j.XXXAppender">
<param name="Threshold" value="FATAL"/> <!-- levels this appender emits
-->
...
</appender>

<root>
<level value="INFO"/>
<appender-ref ref="FILE"/>
<appender-ref ref="SMTP"/>
</root>


Hope that's what you're looking for.

Olli

-----Original Message-----
From: Waldemar Thiel [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 09, 2004 4:49 AM
To: [EMAIL PROTECTED]
Subject: XML configuration help needed - 2 appenders - File for INFO
priority and File plus SMTP for FATAl



Hello 

I'm trying to configure my log4j to work in this way: 

1/ log message with priority INFO should be logged only into file
(FileAppender) 
2/ log message with priority FATAL should be logged to same file as
priority INFO, but additionaly it should be send via SMTP server. 

Is such a configuration possible? I'm tried to configure log4j to work
in this way but always failed. 
Can some1 send me simple example of configuration using XML file? 

Best regards, Waldek 

-----------------------------
Waldemar Thiel
e-mail: [EMAIL PROTECTED]


Reply via email to