View source | Discuss this page | Page history | Printable version   

Module:DB Pool Logging Utilities



DB Pool Logging Utilities is a community module that provides the ability of generating log for some events of database Pool.

It is primarily intended to be used by developers to facilitate them to pinpoint the code that is causing performance issues related to database queries/connections.

This information is logged in standard openbravo log.


Performance considerations

When installing this module, especially in production environments, take into account that, depending on how it is configured, it can cause an overhead in terms of performance. Read carefully Configuration section to select the settings before using it. You can find here some measures taken regarding this overhead.

What to log

Slow Queries

Logging slow queries is important to fine tune them. DB logs (ie. min_duration_statements in PostgreSQL) allows to log them, but sometimes it is not easy from those logs to reach the code that triggered the query. Adding stack traces to logged slow queries helps to easily know the code behind the queries.


Some times, it is useful also to know all the connections that are present in the pool, understanding where they were borrowed for last time.


This module is highly configurable in order to exactly determine what to log. Note that by default the module is not enabled, so even it is installed in the Openbravo instance, it will not log anything until it is configured.

There are two ways to configure the settings for this module: and MBeans.

How to set parameters

Bulbgraph.png   Note after any change in, you will need to compile and restart Tomcat in order to make it effective.

All parameters described in Configuration section can be set through file. The properties are named db.pool.logger. followed the parameter name to configure starting in lowercase. For example to enable logging, use: db.pool.logger.enabled=true.

Settings defined in are applied when Tomcat starts.


It is also possible to change logging configuration in a live instance using JMX MBeans. The MBean is registered in Openbravo:contextName-name=DBPoolLogger where contextName is the application's context name.

There are different clients to connect to JMX MBeans:



Settings for logging statements:

Stack trace configuration:

Settings for logging connections:

Logging connections, these features are only available through JMX MBeans in case TrackConnections is set to true:

Retrieved from ""

This page has been accessed 2,228 times. This page was last modified on 20 June 2017, at 07:27. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.