It's all about the answers!

Ask a question

Tracing the server


Christophe Elek (2.9k12921) | asked Jun 25 '07, 6:07 a.m.
JAZZ DEVELOPER
Anyone knows how to trace the server ?
It seems we are using log4j, anyone knows how to configure the properties
so I can see traces ?

--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational

One answer



permanent link
James Synge (511) | answered Jun 26 '07, 11:58 a.m.
You'll need a log4j properties file, and you'll need to set the system property that log4j reads to find that properties file.

The properties file controls where the logged messages go, what their format is, and which messages are logged. For example, here is the file I use when debugging (note that I edit it to select what I want logged).


# log4j Properties file.
#
# Add the following to the command-line to use this file:
#
# -Dlog4j.configuration=file:///C:\workspaces\log4j.properties
#
# Comments on useful settings:
#
# log4j.rootLogger=DEBUG, stdout
#
# Turns the logging on for the DEBUG level (default is WARN)
#
# log4j.logger.sqlTxLogger=DEBUG
#
# Dumps the sql statements that are being executed along with the transaction boundaries.
#

# Default logging is for WARN and higher
log4j.rootLogger=WARN, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

#log4j.appender.stdout=org.apache.log4j.FileAppender
#log4j.appender.stdout.File=D:\\wtp_0.7_allinone\\trace.log

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %-50.50c - %m%n
# Get file and line numbers, but it's very expensive...
#log4j.appender.stdout.layout.ConversionPattern=%-8r %5p (%F:%L) - %m%n
#Default conversion pattern
#log4j.appender.stdout.layout.ConversionPattern=%r %p %c %x - %m%n
# Another example pattern
#log4j.appender.stdout.layout.ConversionPattern=%5p (%F:%L) - %m%n

# turn on low-level sql tracing (very verbose)
#log4j.logger.sqlTxLogger=DEBUG

#log4j.logger.com.ibm.team.internal.repository.QueryBindingCreator=DEBUG
#log4j.logger.com.ibm.team.internal.repository.RdbRepositoryDataMediator=DEBUG


To set the system property log4j.configuration, I would edit
the server.startup.bat script in the jazz/server directory,
and add to the CATALINA_OPTS envvar (see the top of the
above sample file for the syntax).

Your answer


Register or to post your answer.