Configuring ClearQuest CM API logging

You can configure ClearQuest® CM API logging.

About this task

ClearQuest CM API logging is controlled by using the logging.properties file that is associated with the JRE that runs your application. The logging.properties file is located in the jre\lib directory of your JDK.

Logging is disabled by default. You should enable logging at the INFO level.

The following sample logging.properties file illustrates how to configure log settings for applications that use the ClearQuest CM APIs.
############################################################
#      Global properties
############################################################
#
# "handlers" specifies a comma separated list of log Handler 
# classes.  These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers = java.util.logging.ConsoleHandler

# To also add the FileHandler, use the following line instead.
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers.  For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
# The next line enables logging (for all logger objects) to occur at the INFO level
.level=INFO

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# CMLogger - Should always be enabled at the INFO level. 
#
# The following lines designate logging for the CMLogger object to occur at the INFO level,
# and that the log output file will be named CMLogger[#].log, located in the logged-in
# user's HOME directory; the log output file will rotate through 20 files, each file being
# limited to 20000000 bytes.  Log entries will be appended to the current log output
# file in the rotation and will be written using a simple format.
#
com.ibm.rational.stp.common.internal.util.CMLogger.level = INFO
com.ibm.rational.stp.common.internal.util.LogHandler.pattern = %h/CMLogger%g.log
com.ibm.rational.stp.common.internal.util.LogHandler.limit = 20000000
com.ibm.rational.stp.common.internal.util.LogHandler.count = 20
com.ibm.rational.stp.common.internal.util.LogHandler.append = true
com.ibm.rational.stp.common.internal.util.LogHandler.formatter = java.util.logging.SimpleFormatter

# CMTracer - Enable (uncomment) the entries below for temporary use only, as tracing
# can be resource intensive.  
#
# The following lines designate tracing for the CMTracer object to occur at the FINER level,
# and that the trace output file will be named CMTracer[#].log, located in the logged-in
# user's HOME directory; the trace output file will rotate through 20 files, each file being
# limited to 20000000 bytes.  Trace entries will be appended to the current trace output
# file in the rotation and will be written using a simple format.
#
#com.ibm.rational.stp.common.internal.util.CMTracer.level = FINER
#com.ibm.rational.stp.common.internal.util.TraceHandler.pattern = %h/CMTracer%g.log
#com.ibm.rational.stp.common.internal.util.TraceHandler.limit = 20000000
#com.ibm.rational.stp.common.internal.util.TraceHandler.count = 20
#com.ibm.rational.stp.common.internal.util.TraceHandler.append = true
#com.ibm.rational.stp.common.internal.util.TraceHandler.formatter = java.util.logging.SimpleFormatter

These settings result in a log file named CMLogger[#].log, where [#] designates the file rotation number. Each file is located in the HOME directory of the logged-in user; the output rolls from file to file as each is full.

Using the logging.properties entries in the previous example designates that the log records are appended to the end of the applicable file, and each entry is stored in simple format. You must stop and restart the application for the changes to the file to be recognized.

When a log output file is full, a new file is created and the previous file is renamed to contain the date and timestamp when the file rotation occurred. Each file holds 20 MB of data and new entries are appended to the existing entries, including across application restarts. When the log file count reaches 20, the rotation to a new file causes the oldest file to be deleted.

For more information about how to configure Java™ logging, see the Javadoc documentation associated with your JDK for java.util.logging.Logger and java.util.logging.FileHandler.

If you create a custom log properties file, you must specify the location of the file by using the -D argument. For example:

java -Djava.util.logging.config.file=C:\myLogPropsFile.properties your_client_java_program_that_uses_CM-API

Feedback