Showing posts with label logging. Show all posts
Showing posts with label logging. Show all posts

30 August 2018

Glassfish console log timestamps

By default glassfish does not add timestamps to console logging messages and that allways leaves me wondering wether I'm looking at an old message or a new one.
To add timestamps edit $GLASSFISH_INSTALL/glassfish/domains/domain1/config/logging.properties
Replace domain1 with the domain your domainin the above,  if you are not using the default domain.
change:
java.util.logging.ConsoleHandler.formatter=com.sun.enterprise.server.logging.UniformLogFormatter
to:
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter

The default format is fine for me, but you can customize the format using:
java.util.logging.SimpleFormatter.format="your %format string"

The javadoc contains some format string examples.
Then (re)start the server.

18 September 2011

Java logging toolkit levels mapping

A comparison of the logging levels (or methods) in different logging toolkits. I omitted the ALL and NONE levels.

java.util logging log4j/slf4j
FINEST TRACE
FINE DEBUG
INFO INFO
WARNING WARN
SEVERE ERROR