You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Venugopal Siripuram <sv...@wilco-int.com> on 2001/02/20 06:48:14 UTC

RE: Regarding Log File size and logging different messages to dif fere nt appenders.

	Hi, Naveen..
	1) You can limit the size of the file specifing the attribute 'size'
in an appender tag
	<param name="File"   value="example.log"/> 
	<param name=MaxFileSize value=100KB/>
	 The output will  be directed to the example.log file. This file
will be rolled over when it reaches 100KB. When roll-over occurs, the old
version of example.log is automatically moved to example.log.1. 
	2)to write log messages which satisfies the exact match of priority
level to a particular appender
	u can specify the following tag with in the appender tag
	<filter class="org.apache.log4j.varia.PriorityMatchFilter">
	                  <param name="PriorityToMatch" value="WARN" />
	                  <param name="AcceptOnMatch" value="true" />
	</filter>
	for more information on this see
org.apache.log4j.varia.PriorityMatchFilter
	of the documentation 


> -----Original Message-----
> From:	Veluri, Naveen [SMTP:naveen.veluri@tgslc.org]
> Sent:	Tuesday, February 20, 2001 2:07 AM
> To:	'log4j-dev@jakarta.apache.org'
> Subject:	Regarding Log File size and logging different messages to
> differe nt appenders.
> 
> 
> 
> Hi,
>  I was looking on the log4j API and wanted help on two questions.
> 
> Regarding logging the messages after reading from an XML file :
> 1. how can we restrict the number of messages we can log and can we format
> messages to a new file after some limit to the existing log file or is
> there
> a better way performance wise.
> 
> 2. Also i want to log different messages to different Appenders. For
> example
> say 3 appenders - console, file and NTEventLog and I wanna log debug and
> info to console, info and warning to file and Error and fatal messages to
> NTEventLog then how do we organise these things with XML file and also
> with
> source.
> Can I get answers to these questions with examples please if possible.I
> would really appreciate your help.
> 
> Thanking You,
>  Yours Sincerely,
> Naveen Veluri.
>  TGSLC.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


----------------------------------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential 
and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please 
contact the sender and delete the material from any computer.
----------------------------------------------------------------------------------------------------------------------------