4.4. Tracing SQL Requests Through P6Spy

The P6Spy tool is integrated within JOnAS to provide a means for easily tracing the SQL requests that are sent to the database (see http://www.p6spy.com/).

To enable this tracing feature, perform the following configuration steps:

  1. Set the datasource.classname property of your DataSource properties file to com.p6spy.engine.spy.P6SpyDriver

  2. Set the realdriver property in the spy.properties file (located within $JONAS_BASE/conf) to the JDBC driver of your actual database

  3. Verify that logger.org.objectweb.jonas.jdbc.sql.level is set to DEBUG in the $JONAS_BASE/conf/trace.properties file.

Example:

DataSource properties file contents:

datasource.name�������jdbc_3
datasource.url        jdbc:postgresql://your_host:port/your_db
datasource.classname��com.p6spy.engine.spy.P6SpyDriver
datasource.username   jonas
datasource.password   jonas
datasource.mapper     rdb.postgres

Within the $JONAS_BASE/conf/spy.properties file:

realdriver=org.postgresql.Driver

Within the $JONAS_BASE/conf/trace.properties file:

logger.org.objectweb.jonas.jdbc.sql.level  DEBUG