Alerta-JUL – Elegant log tailing

Classic tailing

In my day to day activities, there is one thing I do everytime and I think every developer does : I tail the logs. The problem with logs checking is that you are rapidly facing a huge file, and the classic tail -f is not enough. The sad part of log tailing is that you only have monochrome logs, without any colouring of any kind helping you identify critical lines against more common ones.
Continue reading

Glassfish v3.x – custom log levels

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…