5 Replies Latest reply on Jun 23, 2011 2:18 AM by firasarabo

    How do I configure this type of logging????

    askesis

      I want to log the output from all classes of a certain package into a seperate logfile. I have found out how to log the output of a certain deplayment .ear to a separate file but because that also contains the JBoss output it is too verbose.

      Is this possible, and if so, could you give me an example/pointer to docs of how to do that (I have read and tried the wiki with no luck)?

      TIA

      Joost

        • 1. Re: How do I configure this type of logging????
          jaikiran

          Try this out:

          <appender name="MY_FILE" class="org.jboss.logging.appender.RollingFileAppender">
           <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
           <param name="File" value="${jboss.server.home.dir}/log/someFile.log"/>
           <param name="Append" value="false"/>
           <param name="MaxFileSize" value="50MB"/>
           <param name="MaxBackupIndex" value="20"/>
          
           <layout class="org.apache.log4j.PatternLayout">
           <param name="ConversionPattern" value="%d{ISO8601} [%X{TAPUSERNAME}] %-5p [%c] %m%n"/>
           </layout>
           </appender>
          
          
           <category name="myPackage.myClass">
           <priority value="DEBUG"/>
           <appender-ref ref="MY_FILE"/>
           </category>




          • 2. Re: How do I configure this type of logging????
            askesis

            Hi Jaikiran,

            This still shows *all* output of JBoss in the new file, not just from the package "myPackage" and all the classes in the package.

            Adding






            reduces the clutter, but it still shows stuff from JBoss and I only want thing from my MyApplication.ear that are from my myPackage...

            • 3. Re: How do I configure this type of logging????
              askesis

              This is what I added:

               <filter class="org.jboss.logging.filter.TCLFilter">
               <param name="AcceptOnMatch" value="true"/>
               <param name="DeployURL" value="MuntpostDevServer.ear"/>
               </filter>
              


              Sorry for the inconvenience

              • 4. Re: How do I configure this type of logging????
                askesis

                I solved it by removing the appender-ref from root

                • 5. Re: How do I configure this type of logging????
                  firasarabo

                  I have a similar requirement. I have a.war and b.war deployed into jboss I am able to let the log coming out of each war file to be logged into a separate log file using filter, a.log and b.log respectively.

                   

                  both a.war and b.war are using some library e.g. "com.some.thing" and I wanted to have a separate log file for everything that is coming out of this package. and I was able to do that by doing an appender and then a category like:

                   

                  <category name="com.some.think">

                       <priority value="INFO"/>

                       <appender-ref ref="MYFILE"/>

                  </category>

                   

                  so now I have 3 log files

                  a.log

                  b.log

                  myfile.log

                   

                  however the log printed in myfile.log also showing in either a.log or b.log, the question is how to prevent log statement coming out of com.some.thing from being printed in either a.log or b.log?

                   

                  Thanks,

                  Firas