pureQuery uses the java.util.logging framework. For information about pureQuery logging and the java.util.logging framework, see Java application usage notes.
The following table lists the database events logged for the com.ibm.pdq.database property.
Log level | Database event |
---|---|
CONFIG | SQL errors listed in dumpLogsOnSqlCodes and not listed in dumpLogsExcludedSqlCodes |
FINE | Refresh of pureQuery properties from a repository |
FINER | Dynamic PREPARE of an SQL statement by pureQuery client optimization |
FINEST | Static PREPARE of an SQL statement by pureQuery client optimization |
If the application is configured to use a repository for pureQuery data, pureQuery Runtime can store a small subset of the log records in the repository. The repository must be specified in the global pdq.properties file. Repository locations that are specified at the application level or data source level are ignored for logging purposes.
select * from ibmpdq.log
For stand-alone Java users, log levels can be managed with the pureQuery Runtime pdq.properties file and in other ways. If the application manages pureQuery component logging with the pdq.properties, the log file can reside on disk or the contents of the log can be stored in a repository. To control log levels for pureQuery component logging, JRE supports logging.properties file in the JRE/lib folder.
For the pureQuery component logging properties, the child log properties inherit the log setting of the parent level. You can override the parent level log setting by explicitly setting child log setting.
For example, if you set only the log level of the com.ibm.pdq.co property to FINE, the log level of the child properties com.ibm.pdq.co.static and com.ibm.pdq.co,dynamic are also FINE.
You can use the methods provided by java.util.logging to set log levels. Other applications might have other methods to manage java.util.logging loggers as well.
If you do not set a log level on any of the pureQuery component log properties, they inherit the level of their parent (for example com.ibm) in a WebSphere® environment.
The following WebSphere Application Server example sets pureQuery component log properties to ALL:
com.ibm.pdq.*=all
In order to set log levels for the pureQuery component tracing, you can use the following syntax in a global pdq.properties file:
pdq.traceLevel=OFF
pdq.traceLevel.com.ibm.pdq.co=FINER
pdq.traceLevel.com.ibm.pdq.co.static=FINE
These pureQuery Runtime properties can be specified in a pdq.properties file on disk or in a repository. When pureQuery Runtime refreshes the properties from the repository at refresh interval, the log levels are applied to the pureQuery loggers.
There is no equivalent to pdq.traceFile for the pureQuery component logging properties.
The pureQuery Runtime properties that are used for tracing pdq.traceLevel and pdq.traceLevel.com.ibm.pdq.*, and the property dumpLogsOnSqlCodes can be specified in a repository. You set the pureQuery Runtime properties in a pdq.properties file and upload information in the file to a repository. If a repository refresh interval is specified, the updated log properties are read from the repository at the specified time and are applied to the application enabled with pureQuery Runtime.
The repository must be specified in the global pdq.properties file. Repository locations that are specified at the application or data source level are ignored for logging purposes.
You can use the ManageRepository utility with the -pureQueryProperties option to upload a pureQuery Runtime properties file to a repository. The following command is run from a script, and uploads the file pdq.properties that contains trace levels into a repository:
java -cp %PQ_USER_CLASSPATH% com.ibm.pdq.tools.ManageRepository
-update runtimeGroup
-pureQueryProperties pdqrep.properties
-runtimeGroupID %1 -runtimeGroupVersion %2
-repositoryURL %PQ_REP_URL%
-repositoryUsername %PQ_REP_USERNAME%
-repositoryPassword %PQ_REP_PASSWORD%
-repositoryDriverClass com.ibm.db2.jcc.DB2Driver
When the script is run from the command line, the variables %1 and %1 are replaced with values specified when the script is run. The variables such as %PQ_USER_CLASSPATH% are replaced by values specified by environment variables.