3 Replies Latest reply on May 13, 2004 6:27 AM by formenti

    log4j and jboss

    ajay_falcon

      Hi.
      it seems that u cannot separate jboss's logging from any webapp's logging and ejb's logging running in Jboss. Classes using log4j in jboss inherits jboss's log4j.xml config. My categories get listed but i am not able to change their priority level. Does anyone know how to change the individual category priority levels? can you post a samle config file!

      i'm using jboss 3.2.3.

        • 1. Re: log4j and jboss

          With this I can set DEBUG level on System.out only for my classes:

          <appender name="ARIA" class="org.apache.log4j.ConsoleAppender">
           <param name="Target" value="System.out"/>
           <param name="Threshold" value="DEBUG"/>
          
           <layout class="org.apache.log4j.PatternLayout">
           <!-- The default pattern: Date Priority [Category] Message\n -->
           <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
           </layout>
           </appender>


          and:

           <category name="it.aria" additivity="false">
           <appender-ref ref="ARIADNE"/>
           </category>
          
          


          • 2. Re: log4j and jboss
            ajay_falcon

            hi formenti,

            I tried your sample config.
            This is what i have done. I have a separate log4j config file in which i have defined my appenders and categories. I load these through a servlet at application startup. In the servlet i list all the available categories. The categories that i have defined are listed. The problem is in changing their priorities. The only priority that seems to work is ERROR. That is if i put the line in code log.error("Some message"); then this message is shown on the console. But none of the other priority messages are shown.
            Can you help me out.

            Ajay.

            • 3. Re: log4j and jboss

              usually I configure log4j only via /conf/log4.xml... i put org.jboss category to INFO and, with the code that i posted, my classes to DEBUG level.
              I haven't idea how to do with separate log4j file, Im'm sorry. But if you find a solution, please post it to me that i'm interesting about log4j tuning!

              Thanx
              Gio