Use attached example as a starting point. "debug" gets all logs, while
"normal" gets only INFO and higher. Refer to the javadoc of the filters
for more information. But for your problem you don't need any more
complex solution.

On Mon, 3 Mar 2003 12:07:56 +0100, Hazejager, S. - SPLXE wrote:

>Yes, that is what I was thinking about. Is there any documentation regarding
>filters? I looked through the Javadoc, but that was not very enlightening...
>
>Sven
>
>-----Original Message-----
>From: Ferenc Toth [mailto:[EMAIL PROTECTED]
>Sent: Monday, March 03, 2003 12:05 PM
>To: Log4J Users List
>Subject: Re: Multiple appenders with differing levels?
>
>
>On Mon, 3 Mar 2003 11:51:19 +0100, Hazejager, S. - SPLXE wrote:
>
>>Hi,
>>
>>I'm looking for a (simple) solution to the following problem.
>>We would like to be able to configure one logging level for our entire
>>application, with output going to one file (intended to be read by
>>developers and maintenance). In addition, we would like FATAL errors to go
>>to a separate file (for operations). No lower levels should be logged, even
>>if the global level is set to DEBUG.
>>Is this possible with only one configured logger (i.e. the root logger)?
>
>Use two appenders. Attach a simple filter to the "fatal" appender that
>filters log4 with only fatal level.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>**********************************************************************
>For information, services and offers, please visit our web site: http://www.klm.com. 
>This e-mail and any attachment may contain confidential and privileged material 
>intended for the addressee only. If you are not the addressee, you are notified that 
>no part of the e-mail or any attachment may be disclosed, copied or distributed, and 
>that any other action related to this e-mail or attachment is strictly prohibited, 
>and may be unlawful. If you have received this e-mail by error, please notify the 
>sender immediately by return e-mail, and delete this message. Koninklijke Luchtvaart 
>Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for 
>the incorrect or incomplete transmission of this e-mail or any attachments, nor 
>responsible for any delay in receipt.
>**********************************************************************
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>

	<appender name="debug" class="org.apache.log4j.DailyRollingFileAppender">
		<param name="File" value="logs\\debug.log"/>
		<param name="DatePattern" value=".yyyy-ww"/>
		<layout class="org.apache.log4j.PatternLayout">
  		     <param name="ConversionPattern" 
                            value="%4d{HH:mm:ss,SSS} %-5p [%t] - %c: %m%n"/>
		</layout>
	</appender>

	<appender name="normal" class="org.apache.log4j.DailyRollingFileAppender">
		<param name="File" value="logs\\server.log"/>
		<param name="DatePattern" value=".yyyy-ww"/>
		<param name="BufferedIO" value="true"/>
		<param name="BufferSize" value="4096"/>
		<layout class="org.apache.log4j.PatternLayout">
  			<param name="ConversionPattern" value="%4d{dd MMM yyyy HH:mm:ss} %-5p [%t] - %c: %m%n"/>
		</layout>
		<filter class="org.apache.log4j.varia.LevelRangeFilter">
			<param name="LevelMin" value="INFO" />
		</filter>
	</appender>

	<root>
		<priority value="debug"/>
		<appender-ref ref="debug"/>
		<appender-ref ref="normal"/>
	</root>
</log4j:configuration>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to