StarQuest Technical Documents

Logging StarSQL for Java Activity

Last Update: 29 February 20016
Product: StarSQL for Java
Version: 2.2 or later
Article ID: SQV00SJ001

Abstract

The StarSQL for Java driver provides a facility for tracing API activity and logging DRDA communications between the driver and the DB2 host. You can log driver events, errors, API calls, and other internal driver activity to the console or a file, or to both. Typically only messages of high severity are logged to the console and you should not need to enable other logging unless you are working with a StarQuest Technical Support engineer to troubleshoot a problem. See the StarSQL for Java User's Guide for detailed instructions.

Solution

Tracing DRDA Communications

To log DRDA activity, set the connection parameter drdaTrace to true in the connection URL or DataSource - e.g. jdbc:StarSQL_JDBC://myhost:446/MYRDBNAME;drdaTrace=true.

The resulting binary files (with an extension of .sqd) will be created in the program directory of the active application. Typically, the files are sent to StarQuest Support for examination; they may be examined with the DRDA Trace Viewer application installed (as a custom option) with StarSQL for Windows.

Be sure to turn off DRDA tracing after collecting the trace files.

It may be difficult to obtain DRDA traces under certain condition, such as running the application with a userID that does not have write access to the application program directory. In these situations, you may be asked by StarQuest Customer Support to install StarPipes for Windows in order to generate DRDA traces for troubleshooting purposes. See How to Generate DRDA and Debug Traces Using StarPipes for Windows.

Tracing API Activity

  1. Copy the sample configuration file that is provided with StarSQL for Java, sqlogging.properties, from the StarSQL for Java installation directory to the lib directory where the JRE is installed.  This typically would be a directory such as C:\Program Files\Java\jre1.6.0_07\lib on Windows, or /usr/jre1.6.0_07/jre/lib on UNIX.
  2. Open the (newly copied) sqlogging.properties file in a text editor.
  3. Edit the FileHandler configuration properties to set a location for the logging files, file size, file count and logging level (see the sample below). Save the file.
  4. Restart the Java application using StarSQL, reproduce the behavior or problem you wish to capture in the log files.
  5. After capturing the log files, rename the sqlogging.properties file, or remove the sqlogging.properties file to disable the logging.

Sample sqlogging.properties File

##########################################################
#Default Logging Configuration File
##########################################################
#Global properties
##########################################################
# Default global logging level.
# This specifies which types of events are logged across
# all loggers. This global level can be overridden by the
# FileHandler.level property and the ConsoleHandler.level
# property.
.level = ALL
##########################################################
#FileHandler configuration properties.
##########################################################
# Write messages of level WARNING and above to 5 rotating files
# in the user's home directory.
FileHandler.pattern = %h/starsql_java%g.log
FileHandler.limit = 150000
FileHandler.count = 5
FileHandler.level = ALL
##########################################################
#ConsoleHandler configuration property.
##########################################################
# Display messages of level SEVERE on the computer monitor.
ConsoleHandler.level = ALL


DISCLAIMER

The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization.  The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.