8th Chapter Software Log
8.1. Configure
PVM can use JDK logs (java.util.logging) or log4j. When the first information is recorded, the PVM log is selected according to the following procedure:
1. If a logging.properties resource is found in classpath (using the context ClassLoader), then the JDK log will be used to implement the JDK log.
2. If log4j is found in Classpath, then log4j will be used. The detection of log4j is achieved by detecting the Org.apache.log4j.LogManager in the context ClassLoader.
3. If the above is not found, the JDK log is used.
8.2. Table of Contents
The PVM class uses their own class masterpieces as log directories.
It is best to turn on the debug level in order to make a basic effort on what the PVM class is doing. The trace level seems to have too much output for this purpose.
8.3. JDK Log
In the JDK log, debug maps to fine, and trace maps to finest. The finer level is not used.
Org.jbpm.pvm.internal.log.LogFormatter is part of the PVM library, which creates a good single-line output for log information. It also has a flexible feature that creates a unique label for each thread. To configure it, this is a common logging.properties
handlers = java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = org.jbpm.pvm.internal.log.LogFormatter
# For example, set the com.xyz.foo logger to only log SEVERE messages:
# com.xyz.foo.level = SEVERE
.level = SEVERE
org.jbpm.level=FINE
org.jbpm.tx.level=FINE
org.jbpm.pvm.internal.wire.level=FINE
8.4. Debug persistence
The following log configuration is valuable when testing for persistence. The directory Org.hibernate.SQL displays the executed SQL statement, and the directory Org.hibernate.type displays the parameter values set in the query.
org.hibernate.SQL.level=FINEST
org.hibernate.type.level=FINEST
Once you get a failure process, such as a hibernate exception, you might want to set the batch size to 0, like this in the hibernate configuration:
Hibernate.jdbc.batch_size = 0
Also in the Hibernate configuration, the following configuration allows logging details of SQL log hibernate output:
hibernate.show_sql = true
hibernate.format_sql = true
hibernate.use_sql_comments = true