jBPM-4.0 Chinese Development Guide-Chapter 8th software Log

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.