In Glassfish v2, you can easily set log levels using the admin console by going into Application Server > Logging > Log Levels. There you can add custom filter and change levels only by using the console.

In the new stable release of Glassfish, this option has disappeared, you can edit levels but there is no easy way to add custom filters. The trick is to alter manually the logging.properties file located in <yourdomain>/config directory. For example, if you want to filter out logs from Sun's Portlet Container, you have to set the following in the logging.properties file :

debug.com.sun.portlet.portletcontainer.impl.level=FINEST

Please notice the .level at the end of the fully qualified name of the class hierarchy to filter. After adding the new entry, you will be able to alter level via the admin console of Glassfish, or even simpler, simply edit the file : the changes are taken on the fly (in certain conditions, you might need to restart the server) !

Hope it'll help...

comments powered by Disqus