If I had a dollar for every time I've looked this up...
To configure JDK logging, you can either edit the file JAVA_HOME
/lib/logging.properties
,
or you can define the system property java.util.logging.config.file
to point to another file. The file
looks like this:
handlers = java.util.logging.ConsoleHandler,java.util.logging.FileHandler
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
.level = INFO
org.hibernate.SQL.level = FINE
org.hibernate.type.level = FINEST
The level specification in bold is a common gotcha - it limits the level of the messages that are shown on the console. The levels are: FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE (and OFF). More details can found in the javadoc for java.util.logging.LogManager.