Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-9461

problem with jboss 5.1.0.GA log4j to separate log using appender filtering on war name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Logging
    • None
    • High
    • Hide

      1/ Deploying minimum 3 applications on the default server instance of a jboss 5.1.0.GA domain.
      Theses 3 applications must use log4.
      They should trace a message logging with the simple application name : myWebAppX.war

      2/ Configuring and upgrade jboss-logging

      • Edit the file jboss-log4.xml and add the following to separate the log of th 3 applications (myXWebApp1.war, myXWebApp2.war and myXWebApp3.war) from the default server log (server.log)

      <appender name="AppWebApp1" class="org.jboss.logging.appender.DailyRollingFileAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
      <param name="File" value="${jboss.server.log.dir}/admin-fonct-server.log"/>
      <param name="Append" value="false"/>
      <param name="DatePattern" value="'.'yyyy-MM-dd"/>
      <layout class="org.apache.log4j.PatternLayout">
      <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
      </ Layout>
      <filter class="org.apache.log4j.varia.LevelMatchFilter">
      <param name="levelToMatch" value="INFO"/>
      </ Filter>
      <filter class="org.jboss.logging.filter.TCLMCFilter">
      <param name="AcceptOnMatch" value="true"/>
      <param name="DeployURL" value="myWebApp1.war"/>
      </ Filter>
      <! - End the filter chain here ->
      <filter class="org.apache.log4j.varia.DenyAllFilter"/>
      </ Appender>

      <category name="com.company.dsi">
      <appender-ref ref="App1Log"> </ appender-ref>
      <appender-ref ref="App2Log"> </ appender-ref>
      <appender-ref ref="App3Log"> </ appender-ref>
      </ Category>
      <category name="org.hibernate">
      <appender-ref ref="App1Log"> </ appender-ref>
      <appender-ref ref="App2Log"> </ appender-ref>
      <appender-ref ref="App3Log"> </ appender-ref>
      </ Category>

      ... The same for the two others applications.

      Upgrading folowwing library from 2.1.0GA to 2.1.1.GA:
      jboss-logging-log4j.jar
      jboss-logging-jdk.jar
      jboss-logging-spi.jar

      Restart the default server.

      3/ Editing the 3 log files and compare them : myXWebApp1.log , myXWebApp2.log and myXWebApp3.log.
      The log of the 3 application will be in the 3 files.

      Show
      1/ Deploying minimum 3 applications on the default server instance of a jboss 5.1.0.GA domain. Theses 3 applications must use log4. They should trace a message logging with the simple application name : myWebAppX.war 2/ Configuring and upgrade jboss-logging Edit the file jboss-log4.xml and add the following to separate the log of th 3 applications (myXWebApp1.war, myXWebApp2.war and myXWebApp3.war) from the default server log (server.log) <appender name="AppWebApp1" class="org.jboss.logging.appender.DailyRollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="File" value="${jboss.server.log.dir}/admin-fonct-server.log"/> <param name="Append" value="false"/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> </ Layout> <filter class="org.apache.log4j.varia.LevelMatchFilter"> <param name="levelToMatch" value="INFO"/> </ Filter> <filter class="org.jboss.logging.filter.TCLMCFilter"> <param name="AcceptOnMatch" value="true"/> <param name="DeployURL" value="myWebApp1.war"/> </ Filter> <! - End the filter chain here -> <filter class="org.apache.log4j.varia.DenyAllFilter"/> </ Appender> <category name="com.company.dsi"> <appender-ref ref="App1Log"> </ appender-ref> <appender-ref ref="App2Log"> </ appender-ref> <appender-ref ref="App3Log"> </ appender-ref> </ Category> <category name="org.hibernate"> <appender-ref ref="App1Log"> </ appender-ref> <appender-ref ref="App2Log"> </ appender-ref> <appender-ref ref="App3Log"> </ appender-ref> </ Category> ... The same for the two others applications. Upgrading folowwing library from 2.1.0GA to 2.1.1.GA: jboss-logging-log4j.jar jboss-logging-jdk.jar jboss-logging-spi.jar Restart the default server. 3/ Editing the 3 log files and compare them : myXWebApp1.log , myXWebApp2.log and myXWebApp3.log. The log of the 3 application will be in the 3 files.

      When several applications are deployed on the default instance server on jboss 5.1.0.GA it is not possible to separate logs in different files with log4j
      All applications will log in all different files.

      The filter TCLMCFIlter doesn't work, it lets everything through (like the old TCLFilter).

      Does anyone have a solution?

      Relatives issues :
      ---------------------------
      https://issues.jboss.org/browse/ORG-1260

      Forum:
      http://community.jboss.org/wiki/SeparatingApplicationLogs#comment-8603

              Unassigned Unassigned
              stephane.raban_jira Stéphane Raban (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: