5 Replies Latest reply on Jan 3, 2007 9:13 AM by norman.richards

    log4j configuration with JBoss AS & Seam



      how can I configure log4j (the logging level, the appenders, ...)?

      I would like to have one configuration file per application and log to one file per application in /server/{server-configuration}/log/{applicationname}.log. Last but not least i would like to use log4j.xml, not log4j.properties.

      I searched the docs but all examples seem to be for Tomcat deployement and I want to deploy on JBoss. I crawled the web but everything I found didn't work. I even changed the /server/{server-configuration}/conf/log4j.xml but this didn't work either.

      So I would greatly appreciate any hints / examples / links ...

      Thanks a lot in advance :)

      PS: I use JBoss 4.0.5 & Seam 1.1

        • 1. Re: log4j configuration with JBoss AS & Seam

          I use the one in /server/{server-configuration}/conf/. It works fine for me. Is your log4j.xml setup correctly?

          • 2. Re: log4j configuration with JBoss AS & Seam

            Thanks for your response. All i did was adding

            <category name="com.example">
             <priority value="DEBUG" />

            to /server/{server-configuration}/conf/log4j.xml but JBoss seems to ignore this entry (code is executed but the logging statement is omitted because the logging level is set to INFO).
            Is there any additional configuration necessary in the application or did you only add stuff to /conf/log4j.xml?

            On the other hand i got it working by removing log4j* from /server/{server-configuration}/lib and adding it to the top of my ear but then JBoss cries cause of the missing jars therefore this seems not the way to do it :(.

            • 3. Re: log4j configuration with JBoss AS & Seam

              This page (the part at the end) should help with per-app logging:


              • 4. Re: log4j configuration with JBoss AS & Seam

                Does this mean, that there is no way of providing a log4j.xml together with the application? Maybe it´s just me, but I don´t like the idea of having a "centralized" logging configuration. I would like a more modular approach where I can provide the configuration on a "per-Application" basis.

                Is this possible at all?

                • 5. Re: log4j configuration with JBoss AS & Seam

                  I honestly have no idea. I love the centralized logging and can't imagine why someone would want to lock their runtime logging configuration inside of their application. Most people I run are going exactly the opposite direction to yours. They have been keeping their logging with their application and found that to be inflexibile and hard to maintain.

                  That being said, you should look at one JBoss AS forums to ask about logging specifics. You'll be much more likely to get an informed answer there