Descriptions of properties for logging and tracing

pureQuery provides logging and tracing capabilities with configurable severity levels that control the type of information sent to the log file.

You can set the following two properties:

pdq.traceFile
Specifies the physical file where the log information is written. You can use an absolute path or a path that is relative to the directory in which the pureQuery Log utility runs.
If the file exists for a Java application, pureQuery deletes the content of the file before using the file for new log entries.
pdq.traceLevel
Specifies the level of detail to write to the log file. In order from the least to the most detail, the levels are as follow:
  • OFF
  • SEVERE
  • WARNING
  • INFO
  • CONFIG
  • FINE
  • FINER
  • FINEST
  • ALL
The default level is OFF.

Java application usage notes

pureQuery uses the java.util.logging framework. Within that framework, pureQuery names its parent logger com.ibm.pdq.logger. Using Java™ logging API conventions and tools, you and your applications can set the log level and log file for the com.ibm.pdq logger so that pureQuery log messages are forwarded to this logger.

Any application server which provides administrative tooling to configure loggers under the java.util.logging framework, such as WebSphere® Application Server 6.1, can configure the com.ibm.pdq logger to control pureQuery logging and tracing. Such a configuration provides an alternative to configuring pureQuery logging with pureQuery properties. pureQuery uses the com.ibm.pdq logger level if it is higher than the level that is specified for the pureQuery pdq.traceLevel property and if the com.ibm.pdq logger level is higher than INFO. In the WebSphere Application Server Integrated Solutions Console, you can set the com.ibm.pdq logger level by selecting Troubleshooting > Logs and Trace.

If the com.ibm.pdq logger trace level is set to a level that is more inclusive than INFO, and if pureQuery properties do not specify a level that is more inclusive than the com.ibm.pdq logger trace level, pureQuery inherits the level of the com.ibm.pdq logger.

If you plan to use WebSphere Application Server with your pureQuery application, you must set the level higher than INFO if you want to see pureQuery log entries in the log for WebSphere Application Server.

pureQuery does not explicitly integrate logging with JDBC driver logs. However, JDBC drivers which also log using the Java logging API can participate in the logging framework integration. This means that pureQuery and JDBC driver log entries are interleaved in the same log only if the JDBC driver also uses the Java logging framework and if both loggers are configured to write to the same target.

Exceptions that occur in non-pureQuery API applications that are run under pureQuery appear in pureQuery log files, if logging is configured for pureQuery. Some pureQuery entries might also appear in the JDBC driver log, if one is configured.

Logging the results of calls to the getJccSpecialRegisterProperties() method

If your application uses the IBM® Data Server Driver for JDBC and SQLJ to connect to a supported DB2® database, and calls the getJccSpecialRegisterProperties() method on a Connection object, pureQuery can log the results of the first call to that method on the object. The message that pureQuery writes to the log lists all of the non-null values for the special registers that the driver supports for the database.

To see this message in the log, set the trace level to FINE.

DB2 CLI and IBM Data Server Driver usage notes

When using DB2 Call Level Interface (CLI) or the IBM Data Server Driver with pureQuery Runtime, you can use the pureQuery Runtime property as a configuration keyword.

You can set the two keys in the db2cli.ini or dsdriver.cfg configuration file.

IBM CLI keyword syntax
traceFile = level

You can use an absolute path or a relative path to the directory in which the CLI application runs. If the file exists, new log messages are appended to the existing content of the file.

traceLevel = path-to-logfile
IBM Data Server Driver configuration syntax
<parameter name="traceFile" value="level" />

You can use an absolute path or a relative path to the directory in which the CLI application runs. If the file exists, new log messages are appended to the existing content of the file.

<parameter name="traceLevel" value="path-to-logfile" />
Equivalent IBM Data Server Provider for .NET connection string keywords
N/A

The following lines set the traceFile to /user/CLIOPTtraces.log and the traceLevel to INFO in a db2cli.ini file:

traceFile=/user/CLIOPTtraces.log
traceLevel=INFO

Feedback