4 Replies Latest reply on Jan 30, 2009 7:31 AM by Alexander Zeller

    TCLFilter in JBoss 4.2.3

    Alexander Zeller Newbie

      Hallo!

      I updated JBoss 4.0.5 to JBoss 4.2.3 for my application. Everything works fine except the Logging:

      The TCLFilter seems to have no effect anymore. All log statements are written in all Log-Files insted of separate Files.

      I didn't found any posts in this forum that deals with this problem. Has enyone the same problem, or even a solution?

      Best Regards,
      Alexander Zeller

        • 1. Re: TCLFilter in JBoss 4.2.3
          Peter Johnson Master

          Logging configuration has not changed, but the name of the configuration file change - it is now jboss-log4j.xml.

          If that does not fix the problem, please post your jboss-log4j.xml file. Remember to enclose the XML text in code tags, and use the Preview button to ensure proper formatting before submitting.

          • 2. Re: TCLFilter in JBoss 4.2.3
            Alexander Zeller Newbie

            Hello Peter,

            Yes, I have changed the name of the Log4J configuration file from 'log4j.xml' to ' jboss-log4j.xml' and the logging works fine, except the TCLFilter. But I didn't do any changes to the file content. Is there anything elso to do?

            Here the complete file content of my 'jboss-log4j.xml:'

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
            
            <!-- ===================================================================== -->
            <!-- -->
            <!-- Log4j Configuration -->
            <!-- -->
            <!-- ===================================================================== -->
            
            <!--
             | For more configuration infromation and examples see the Jakarta Log4j
             | owebsite: http://jakarta.apache.org/log4j
             -->
            
            <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
            
             <!-- ================================= -->
             <!-- server.log - File Appender -->
             <!-- ================================= -->
             <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name="File" value="${jboss.server.log.dir}/server.log"/>
             <param name="Append" value="true"/>
            
             <!-- Rollover at midnight each day -->
             <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <!-- The default pattern: Date Priority [Category] Message\n -->
             <param name="ConversionPattern" value="%d [%x] [%-5p] [...%-30.30c:%-5.5L] >> %m%n"/>
             </layout>
            
             </appender>
            
             <!-- ================================= -->
             <!-- ReMaiD - File Appender -->
             <!-- ================================= -->
             <appender name="REMAID_FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name="File" value="${jboss.server.log.dir}/remaid.log"/>
             <param name="Append" value="true"/>
            
             <!-- Rollover at midnight each day -->
             <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <!-- The default pattern: Date Priority [Category] Message\n -->
             <param name="ConversionPattern" value="%d [%x] [%-5p] [...%-30.30c:%-5.5L] >> %m%n"/>
             </layout>
             <filter class="org.jboss.logging.filter.TCLFilter">
             <param name="AcceptOnMatch" value="true"/>
             <param name="DeployURL" value="remaid.ear"/>
             </filter>
            
             </appender>
            
             <!-- ================================= -->
             <!-- TMPC - File Appender -->
             <!-- ================================= -->
             <appender name="DEPROMOS_FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name="File" value="${jboss.server.log.dir}/depromos.log"/>
             <param name="Append" value="true"/>
            
             <!-- Rollover at midnight each day -->
             <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <!-- The default pattern: Date Priority [Category] Message\n -->
             <param name="ConversionPattern" value="%d [%x] [%-5p] [...%-30.30c:%-5.5L] >> %m%n"/>
             </layout>
            
             <filter class="org.jboss.logging.filter.TCLFilter">
             <param name="AcceptOnMatch" value="true"/>
             <!-- IMPORTANT: In this case the DeployURL has to be project-centre and NOT project-centre.war -->
             <param name="DeployURL" value="project-centre"/>
             </filter>
             </appender>
            
             <!-- ================================= -->
             <!-- Transfer Pricing - File Appender -->
             <!-- ================================= -->
             <appender name="TRP_FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name="File" value="${jboss.server.log.dir}/trp.log"/>
             <param name="Append" value="true"/>
            
             <!-- Rollover at midnight each day -->
             <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <!-- The default pattern: Date Priority [Category] Message\n -->
             <param name="ConversionPattern" value="%d [%x] [%-5p] [...%-30.30c:%-5.5L] >> %m%n"/>
             </layout>
             <filter class="org.jboss.logging.filter.TCLFilter">
             <param name="AcceptOnMatch" value="true"/>
             <param name="DeployURL" value="TransferPricing.ear"/>
             </filter>
            
             </appender>
            
             <!-- ============================== -->
             <!-- Append messages to the console -->
             <!-- ============================== -->
            
             <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name="Target" value="System.out"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <!-- The default pattern: Date Priority [Category] Message\n -->
             <param name="ConversionPattern" value="%d{ABSOLUTE} [%x] [%-5p] [...%-30.30c:%-5.5L] >> %m%n"/>
             </layout>
             </appender>
            
            
             <!-- ========================= -->
             <!-- Limit categories -->
             <!-- ========================= -->
            
             <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
             <category name="org.apache">
             <priority value="INFO"/>
             <appender-ref ref="FILE"/>
             </category>
            
             <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
             <category name="org.jboss.serial">
             <priority value="INFO"/>
             <appender-ref ref="FILE"/>
             </category>
            
             <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
             <category name="org.jgroups">
             <priority value="WARN"/>
             <appender-ref ref="FILE"/>
             </category>
            
             <!-- Limit the jacorb category to WARN as its INFO is verbose -->
             <category name="jacorb">
             <priority value="WARN"/>
             <appender-ref ref="FILE"/>
             </category>
            
             <!-- Limit JBoss categories -->
             <category name="org.jboss">
             <priority value="INFO"/>
             <appender-ref ref="FILE"/>
             </category>
            
            
             <!-- ========================= -->
             <!-- TRP_LOGGING -->
             <!-- ========================= -->
             <category name="net.tmobile.trp">
             <priority value="INFO" />
             <appender-ref ref="TRP_FILE"/>
             </category>
            
             <!-- ========================= -->
             <!-- REMAID_LOGGING -->
             <!-- ========================= -->
            
             <category name="net.tmobile.remaid">
             <priority value="INFO" />
             <appender-ref ref="REMAID_FILE"/>
             </category>
            
            
            
             <category name="net.tmobile.remaid.action.UserAdminAction">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.action.LoginAction">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.usermngmnt.User">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.service.PeopleLDAPServiceBean">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.action.TimeRecordingAction">
             <priority value="DEBUG" />
             </category>
            
             <category name="test.tmpc.TmpcTest">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.util.TmpcProjectImporterBean">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.action.ResetPasswordAction">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.action.UserDetailsAction">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.action.ImportProjectsAction">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.remaid.action.RegisterAction">
             <priority value="DEBUG" />
             </category>
            
             <!-- ========================= -->
             <!-- NON-REMAID PRIORITIES -->
             <!-- ========================= -->
            
             <category name="org.hibernate">
             <priority value="INFO" />
             <appender-ref ref="REMAID_FILE"/>
             </category>
            
            
            
             <!-- ========================= -->
             <!-- Depromos Logging -->
             <!-- ========================= -->
            
             <category name="net.tmobile.depromos">
             <priority value="INFO" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="net.tmobile.depromos.business.service.impl.Updater">
             <priority value="DEBUG" />
             </category>
            
             <category name="net.tmobile.depromos.present.menu.condition">
             <priority value="WARN" />
             </category>
            
             <category name="net.tmobile.depromos.present.struts.actions.common">
             <priority value="WARN" />
             </category>
            
             <!-- ========================= -->
             <!-- NON-DEPROMOS PRIORITIES -->
             <!-- ========================= -->
            
             <category name="org.apache.commons">
             <priority value="ERROR" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="org.apache.struts">
             <priority value="ERROR" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="org.apache.struts.action">
             <priority value="ERROR" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="org.apache.cactus">
             <priority value="WARN" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="org.apache.commons.httpclient">
             <priority value="ERROR" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="org.apache.jsp">
             <priority value="DEBUG" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="org.displaytag">
             <priority value="ERROR" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="com.opensymphony">
             <priority value="ERROR" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="com.canoo.webtest">
             <priority value="WARN" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="httpclient">
             <priority value="WARN" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="net.sf.navigator">
             <priority value="WARN" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="net.sf.hibernate">
             <priority value="INFO" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
             <category name="net.sf.hibernate.cfg">
             <priority value="WARN" />
             <appender-ref ref="DEPROMOS_FILE"/>
             </category>
            
            
             <!-- ======================= -->
             <!-- Setup the Root category -->
             <!-- ======================= -->
            
             <root>
             <!-- Fuer Rechner in Bonn auskommentieren, da dort i.d.R keine Konsole zur Verfuegung steht -->
             <appender-ref ref="CONSOLE"/>
            
             </root>
            
            
            </log4j:configuration>
            


            • 3. Re: TCLFilter in JBoss 4.2.3
              Peter Johnson Master

              Based on code changes in TCLFilter, it looks like they changed how it decides if the even should be logged. Now, if acceptOnMatch is true and the TCL does not match, it returns NEUTRAL result instead of a deny RESULT. NEUTRAL means that this filter could not decide one way or the other and the next filter in line should check. According to AppenderSkeleton (in log4j), if there are no other filters returning a NEUTRAL result is the same as returning ACCEPT.

              So yes, it looks like someone broke(?) the code, probably in an effort to fix a bug that someone else issued that said that they could not chain filters.

              There is a org.apache.log4j.varia.DenyAll filter. You could try adding that to the filter chain. (Now I get it, the last filter in the chain should always be a DenyAll, this way is any of the other filters do not specifically ACCEPT the event, the last filter denies it.)

              • 4. Re: TCLFilter in JBoss 4.2.3
                Alexander Zeller Newbie

                Thanks!

                Adding the "org.apache.log4j.varia.DenyAllFilter" works!