Thanks Heri for ur help.. one thing more i want to ask is is this configuration will be done in Log4j.properties..if not then where i have to write all this.And is TraceDenyFilter and XMLDenyFilter are self made filters or do i have two build two classes extending these filters. In case so where i have to save these filter classes.
ur help is really useful to me Bender Heri wrote: > > Here a example how to configure filters. Note: Filters are only available > if you use xml configuration. > > <appender name="CONSOLE.OUT" class="org.apache.log4j.ConsoleAppender"> > <param name="target" value="System.out"/> > <layout class="org.apache.log4j.PatternLayout"> > <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} (%6r) > %-5p [%-7t] %F:%L %x - %m%n"/> > </layout> > <filter class="org.apache.log4j.varia.LevelRangeFilter"> > <param name="LevelMin" value="debug"/> > <param name="LevelMax" value="info"/> > <param name="AcceptOnMatch" value="false"/> > </filter> > <filter > class="ch.ergonomics.pms.common.supervision.TraceDenyFilter"/> > <filter > class="ch.ergonomics.pms.common.supervision.XMLDenyFilter"/> > </appender> > > This appender has three filters attached. The first is a log4j built in > filter (LevelRangeFilter), the thow others are self written filters, > derived from org.apache.log4j.spi.Filter which filter LogEvents based on > some values in MDC. > If a LogEvent reaches an appender, it is presented to the attached filters > in the order they are configured. The Filter results in: > - ACCEPT the LogEvent is accepted, no more further Filters are asked > - DENY the Log Event is rejected, no more further Filters are asked > - NEUTRAL next filter in chain is asked > > within a self written Filter you can implement any logic you want. > > Heri > >> -----Original Message----- >> From: garima015 [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, November 29, 2006 11:39 PM >> To: log4j-user@logging.apache.org >> >> >> >> Can you please give me some more idea on how to create that >> filter..and how >> this will be called >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Log4J-System-alerts-tf2727572.html#a7620430 Sent from the Log4j - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]