You can set the following properties:
If the file exists for a Java™ application, pureQuery deletes the content of the file before using the file for new log entries.
The traceFile property can be specified only in a global pdq.properties file. The property cannot be specified in a pdq.properties file that specifies the properties for an application or an application data source connection.
You can specify the trace level for pureQuery component logging. For information about logging pureQuery component trace information see Specifying the trace level for pureQuery Runtime component properties.
The traceLevel property can be specified only in a global pdq.properties file. The property cannot be specified in a pdq.properties file that specifies the properties for an application or an application data source connection.
If the traceBufferRowCount property is enabled, the pureQuery Runtime property dumpLogsOnSqlCodes must also be specified to write log records to a file. The value of the dumpLogsOnSqlCodes property is a list of SQL error codes. When a listed error occurs, the log records that are buffered in memory are written to the log file. The log file is specified by the traceFile property. If a specified error code is not detected or the property dumpLogsOnSqlCodes is not specified and the maximum amount of memory is reached, the oldest records are deleted from memory when new records are buffered in memory.
The property dumpLogsExcludingSqlCodes can be specified with the SQL error codes that do not trigger writing log records to the log file.
pdq.traceBufferRowCount=8000
pdq.dumpLogsOnSqlCodes=default
The traceBufferRowCount option is designed to be used with stand-alone pureQuery Runtime applications. It is independent of the WebSphere® ring buffer.
pdq.traceBufferRowCount=8000
pdq.dumpLogsOnSqlCodes=-805|-810
pureQuery Runtime writes the log records that are in memory to the log file if either SQL error code -805 or -810 occurs or when the number of records specified by the traceBufferRowCount property is buffered in memory.
pdq.traceBufferRowCount=8000
pdq.dumpLogsOnSqlCodes=default|-3476
If you use the keyword default, you can specify specific SQL error codes dumpLogsExcludingSqlCodes that do not trigger writing buffered log records to the log file. For a list of pureQuery Runtime default SQL error codes, see List of pureQuery Runtime default SQL error codes that are used with logging.
In the following example, buffering log records in memory is enabled for a maximum of 8000 records. pureQuery Runtime writes the buffered log records to the log file when an SQL error code in the default list or the error code -3476 is encountered. The default list of SQL error codes contains the error code -805. The dumpLogsExcludingSqlCodes property specified that SQL error code -805 does not trigger the writing buffered log records to the log file.
pdq.traceBufferRowCount=8000
pdq.dumpLogsOnSqlCodes=default|-3476
pdq.dumpLogsExcludingSqlCodes=-805
pureQuery Runtime uses the java.util.logging framework. Within that framework, pureQuery Runtime 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 so that pureQuery log messages are forwarded to this logger.
Many application servers provide administrative tools to configure loggers that run under the java.util.logging framework. For example, with WebSphere Application Server, you can configure the com.ibm.pdq logger to control pureQuery logging and tracing. Using an application server tooling is an alternative to configuring pureQuery logging with pureQuery Runtime 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
.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 Runtime 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 file if both the JDBC driver and pureQuery Runtime are configured to log to the WebSphere trace.
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.
When using DB2 Call Level Interface (CLI) or the IBM Data Server Driver with pureQuery Runtime, you can use the pureQuery Runtime properties as configuration keywords.
For information about logging and tracing with CLI applications enabled with pureQuery client optimization, see Logging and tracing with pureQuery Runtime.
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.
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.
You can use an absolute path or a relative path to the directory in which the .NET application runs. If the file exists, new log messages are appended to the existing content of the file.
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