StarQuest Technical Documents

Logging StarSQL for Java Activity

Last Update: 28 August 2009
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 more detailed instructions.

If you only wish to log DRDA activity, do not enable the logging and, instead, set the connection parameter drdaTrace to true in the connection URL or DataSource.

Solution

  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.