My new work used Jboss Application Server 7.1 for its web applications. One of the things that surprised me was that it was not straightforward to configure webapps to use log4j.properties for logging configuration.
For development, I like to set all logging to ERROR level, except for the packages I’m working on. To achieve this in Jboss, edit the logging subsystem section in the file ${JBOSS_HOME}/standalone/configuration/standalone.xml.
<subsystem xmlns="urn:jboss:domain:logging:1.1"> <logger category="com.mycompany.project.package"> <level name="DEBUG"/> </logger> <root-logger> <level name="ERROR"/> <handlers> <handler name="CONSOLE"/> <handler name="FILE"/> </handlers> </root-logger> </subsystem>
This will be applied to all webapps deployed in the Jboss instance.