TCK20 Logging

A TCK run involves several tools/components. Each of these components use standard or proprietary logging implementations:

Log files are written under a common root directory tck20/target/logs. All involved tools/components above are configured to write to a separate subdirectory. When you run the TCK, the following directories are created:

Each of these directories contains one or more log files. The log files in the database and enhancer subdirectories are configured to append log messages for consecutive TCK runs. In contrast, the <timestamp> directory is always created for each TCK run. The naming pattern is yyyyMMdd-HHmmss.

Below, log files for all involved tools/components are listed:

TCK20 Logging Configuration Files

Each of the involved logging implementations use different properties files configuring logging. These properties files are located in directory tck20/test/conf:

The TCK junit result logging and the TCK result summary logging are not configurable.

There is another properties file configuring JDK 1.4 logging. This file may be used by implementations under test (iut). It is also used if Apache commons-logging is configured to run with JDK 1.4 logging.

TCK20 Logger Instances

The TCK uses the following logger instances:

Logger Instance

Log Level

Component

org.apache.jdo.tck

INFO

TCK test cases

org.apache.jdo.tck.pc.company.CompanyModelReader

ERROR

SpringFramework

org.springframework

ERROR

SpringFramework

The log level of logger instance org.apache.jdo.tck defaults to INFO. Both remaining logger instances are used by SpringFramework. The log levels of these logger instances default to ERROR.

Note: SpringFramework classes write log messages using log level INFO. Since we do not want to see SpringFramework INFO log messages, we set the log level of SpringFramework logger instances to ERROR. Due to the fact that TCK class org.apache.jdo.tck.pc.company.CompanyModelReader extends a SpringFramework class which retrieves a logger instance calling LogFactory.getLog(getClass()), we have to define a logger instance on class org.apache.jdo.tck.pc.company.CompanyModelReader.

TCK20 Logging Configuration for JDO Vendors

JDO implementations using Log4J or JDK 1.4 logging may use specific file appender or file handler implementations of tck20 in order to write logging output to directory tck20/target/logs/<timestamp>/. This may be achieved by editing file tck20/test/log4j.properties:

# log4j vendor-specific appender
log4j.appender.<vendor> = org.apache.jdo.tck.util.TCKFileAppender
log4j.appender.<vendor>.File = <vendor>.txt

or by editing file tck20/test/logging.properties:

# JDK 1.4 vendor-specific handler
handlers = org.apache.jdo.tck.util.TCKFileHandler
org.apache.jdo.tck.util.TCKFileHandler.fileName = <vendor>.txt
org.apache.jdo.tck.util.TCKFileHandler.level = FINEST

JDO implementations using other logging implementations may use a static public tck20 method to retrieve the name of the logging file to be generated in directory tck20/target/logs/<timestamp>/:

    org.apache.jdo.tck.util.BatchTestRunner#changeFileName(String fileName)

This method returns a file name which is constructed by values of some system properties appended by the given file name. The system properties are:

The returned file name is constructed as follows:

    <jdo.tck.log.directory>/<jdo.tck.database>-<jdo.tck.identitytype>-<jdo.tck.cfg>-<given file name>

Values of properties which do not exist default to "".

Apache commons-logging Configuration

Apache commons-logging allows switching between different logging implementations (including JDK1.4 logging, Log4J and Apache's simple logging implementation). There are three properties files to configure logging:

Properties File

Description

common-logging.properties

Specifies the logging implementation to use.

logging.properties

Logger configuration when using JDK 1.4 logging.

log4j.properties

Logger configuration when using Log4J logging.

simplelog.properties

Logger configuration when using Apache simple logging.

Log Level Mapping between JDK 1.4 and Apache commons-logging

The following table describes the mapping between the log level of JDK 1.4 logging and Apache commons-logging:

JDK 1.4

Apache commons-logging

FINEST

trace

FINE, FINER

debug

INFO, CONFIG

info

WARNING

warn

SEVERE

error, fatal

TCK11 and RI11 Logger Instances

The ri11 implementation uses the following logger instances:

Logger Instance

Log Level

Component

org.apache.jdo.impl.fostore

File Object Store implementation

org.apache.jdo.impl.jdoql

JDOQL query runtime

org.apache.jdo.impl.jdoql.jdoqlc

JDOQL query compiler

org.apache.jdo.impl.model.jdo

JDOModel implementation

org.apache.jdo.impl.model.jdo.xml

XML parser for JDO metadata files

org.apache.jdo.impl.pm

PM and PMF implementation

org.apache.jdo.impl.sco

SCO implementation

org.apache.jdo.impl.state

State manager implementation

org.apache.jdo.store

Generic store manager implementation

org.apache.jdo.util

Utility classes

The ri11 test classes use the following logger instance:

  org.apache.jdo.test

The tck11 test classes use the following logger instance:

  org.apache.jdo.tck

Log Level Mapping between RI11 Logging and Apache commons-logging

The following table maps the log level of the former JDORI util.Logger class to Apache commons-logging log level:

JDORI Logger

Apache commons-logging

TIME, BUF

trace

DEBUG, TEST

debug

INFO

info

WARN

warn

ERROR

error

LoggingDetails (last edited 2009-09-20 23:08:46 by localhost)