5 Replies Latest reply on Jan 5, 2006 1:59 PM by mikemoreira

    Log for specific package

    mikemoreira

      Hi,

      Anyone knows if this is possible, configuring log4j.xml at JBoss 4.0.2?

      I already had configurated the file, using a new appender for my application, but in this file, I´m getting every kind of DEBUG.

      There is any configuration that alows only debug, for example : br.com.myapp.*, logging in my file only the debugger for this package?

      Tks

        • 1. Re: Log for specific package
          starksm64
          • 2. Re: Log for specific package
            mikemoreira

            I had checked this article, but in this case I not able to specify witch package I want to do the log. My principal problem is, when I configure the appender, all the DEBUG messages are writting at my app log file.

            Even the startup of JBoss is comming to my appfile.

            There is anyway to restrict this messages?

            That means, I want to write in my App.LOG file only de DEBUG messages called by br.com.myapp.XXXX, any other DEBUG message should be write only at server.log file

            Tks

            • 3. Re: Log for specific package
              starksm64

              The wiki page shows the org.jboss.mx.loading category msgs and only those msgs going to a ucl.log file. Go over the config again.

              • 4. Re: Log for specific package
                mikemoreira

                I´m using this configuration :





                <param name="DatePattern" value="'.'yyyy-MM-dd"/>








                <appender-ref ref="FILE1"/>


                So, I expected only DEBUG messages from the package "br.gov.sp.tce.audesp" at "audespAPP.log" file, but when I start the JBoss I´m getting a lot of other DEBUG messages from JBoss, and not only from my package.

                This is my entire log4j.xml


                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
                <!-- $Id: log4j.xml,v 1.26.2.2 2005/03/02 14:52:20 tdiesler Exp $ -->
                <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">





                <param name="DatePattern" value="'.'yyyy-MM-dd"/>






















                <param name="DatePattern" value="'.'yyyy-MM-dd"/>





                <!-- ============================== -->
                <!-- Append messages to the console -->
                <!-- ============================== -->










                <!-- ================ -->
                <!-- Limit categories -->
                <!-- ================ -->

                <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->




                <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->




                <!-- Limit apache axis to INFO as its DEBUG is even more verbose -->





                <!-- Limit the JSR77 categories -->






                <appender-ref ref="FILE1"/>


                <!-- ======================= -->
                <!-- Setup the Root category -->
                <!-- ======================= -->


                <appender-ref ref="CONSOLE"/>
                <appender-ref ref="FILE"/>
                <appender-ref ref="SMTP"/>
                <appender-ref ref="FILE1"/>


                </log4j:configuration>

                • 5. Re: Log for specific package
                  mikemoreira






                  <param name="DatePattern" value="'.'yyyy-MM-dd"/>







                  <appender-ref ref="FILE1"/>