Configuring JBoss AS logging level using Log4j
Loggin during the development phase is really important, but when you go in production it can be a problem: in my case my application add about 6MB of log for a single request and this can be a real problem if you have a lot of users. More, writing so much stuff would decrease performance of the application.
If you use JBoss Application Server (that use log4j) it's simple to configure it to do not write a lot of debug stuff for the classes of my applications (that generally are written using JSF + Ajax4Jsf + Richfaces + Seam technologies).
To do that, modify the jboss-log4j.xml file that you find in /< jboss_home_dir >/server/< your_conf >/conf/ and add this code inside the log4j:configuration section:
As you can see it's simple to adapt for other libraries you are using.
Other than INFO you can use other logging levels, they are ordered in that order:
DEBUG < INFO < WARN < ERROR < FATAL.
So using the INFO level log4j will skip DEBUG logs but it will write WARN, ERROR and FATAL logs, using ERROR level it will only write ERROR and FATAL logs an so on.
Demetrio Filocamo
If you use JBoss Application Server (that use log4j) it's simple to configure it to do not write a lot of debug stuff for the classes of my applications (that generally are written using JSF + Ajax4Jsf + Richfaces + Seam technologies).
To do that, modify the jboss-log4j.xml file that you find in /< jboss_home_dir >/server/< your_conf >/conf/ and add this code inside the log4j:configuration section:
< category name="org.jboss">
< priority value="INFO"/>
< /category>
< category name="javax.faces">
< priority value="INFO"/>
< /category>
< category name="org.ajax4jsf">
< priority value="INFO"/>
< /category>
< category name="org.hibernate">
< priority value="INFO"/>
< /category>
As you can see it's simple to adapt for other libraries you are using.
Other than INFO you can use other logging levels, they are ordered in that order:
DEBUG < INFO < WARN < ERROR < FATAL.
So using the INFO level log4j will skip DEBUG logs but it will write WARN, ERROR and FATAL logs, using ERROR level it will only write ERROR and FATAL logs an so on.
Demetrio Filocamo