I have successfully used the TCLFilter to separate application specific logging 
events ["APPLICATION_ONE", "APPLICATION_TWO"].  The problem is that application 
specific events are also being logged to my DailyRollingFileAppender ["FILE"], 
which is undesired behavior.  What is the best way to eliminate this duplicate 
logging?  I attempted to configure  multiple TCLFilters in 
DailyRollingFileAppender ["FILE"] using AcceptOnMatch param = "false", which 
works a single TCLFilter is used, but because of the way the TCLFilter is 
written (see TCLFilter.java below), multiple TCLFilters cannot be used in this 
way(I need to filter both application specific logging events from 
DailyRollingFileAppender ["FILE"]).  I am new to log4j, what am I missing here? 
 Is there another way?


TCLFilter.java
*******************************
   .....
   public int decide(LoggingEvent event)
   {
      int ok = Filter.DENY;
      if( acceptOnMatch == true )
      {
         ok = Filter.DENY;
         if( isMatchingTCL() )
            ok = Filter.ACCEPT;
      }
      else
      {

   /**
    * ok ACCEPT by default, if isMatchingTCL() returns false, no other filters 
are evaluated
    */
         ok = Filter.ACCEPT;
         if( isMatchingTCL() )
            ok = Filter.DENY;
      }
      return ok;
   }
    

log4j.xml
******************************* 
I attempted to post all of the appenders, but the forum would
not accept it for some reason...


   <appender-ref ref="CONSOLE"/>
   <appender-ref ref="FILE"/>
   <appender-ref ref="SMTP"/>
   <appender-ref ref="APPLICATION_ONE"/>
   <appender-ref ref="APPLICATION_TWO"/>


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977027#3977027

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977027
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to