Logging

TM4J uses the Jakarta Commons logging system. This is a thin abstraction layer wrapping various logging facilities, such as Log4J, Avalon logging, and the logging functionality built into JDK 1.4. Is it developed by the Jakarta Commons project team, a subproject of the Apache Software Foundation's Jakarta Project. There is very little you have to do in order to get logging working with TM4J, most setups should require no configuration at all.

The Commons logging system will select its underlying logging facility based on the following procedure:

  1. If the Log4J logging system is available on the classpath, use Log4J. TM4J bundles a Log4J configuration file into tm4j.jar, so it will normally use Log4J if it is available. The configuration file sets the logging threshold to "warning", which should be sufficient for most setups and won't clutter up your screen.
  2. If Log4J is not found on the classpath and the application is running in a 1.4 (or above) JRE, use the built-in logging facility available since JDK 1.4. Note that the global default logging threshold for built-in Java logging is "info", which may produce slightly more output than you find useful. Edit the file logging.properties in the lib subdirectory of your JRE installation if you wish to change the global default logging threshold.
  3. If both of the above failed, fall back to a "simple" logging facility that prints messages to standard error. Like JDK 1.4 logging, this logging facility uses a logging threshold of "info", which you may change to "warning" by setting the org.apache.commons.logging.simplelog.defaultlog system property to warn.

If desired, the Jakarta Commons logging system allows for much more fine-grained configuration. See the Commons logging users guide for details. Most setups, however, shouldn't require such tweaking of the logging system.

TM4J Logging Categories

If you do wish to tweak logging levels to suit your configuration, you will want to know which logging categories are available in TM4J. You may refer to the following table in order to decide which categories of message you need to log and which can be safely ignored.

Note that logging categories are hierarchical, so a logging level defined on a high-level category is inherited by all lower-level categories unless otherwise specified.

To Be Completed

Table 3.8. TM4J Logging Categories

Category IdentifierUse
org.tm4j.topicmapGeneral topic map processing messages
org.tm4j.topicmap.eventsMessages logged when events are generated / handled
org.tm4j.topicmap.indexMessages from general index processing
org.tm4j.topicmap.utilsMessages from the topic map utilities, including the XTMBuilder which creates objects from the parsing of XTM files.
org.tm4j.tologMessages from the Tolog query processor.
org.tm4j.topicmap.backend.memoryMessages specific to the in-memory back-end
org.tm4j.topicmap.backend.hibernateMessages specific to the Hibernate back-end implementation.
org.tm4j.topicmap.backend.hibernate.SIPMessages specific to the creation/deletion of identifiers used to determine topic merging in the Hibernate back-end implementation.
org.tm4j.topicmap.index.backend.memoryMessages specific to the in-memory indexing system.
org.tm4j.topicmap.backend.ozoneMessages specific to the Ozone back-end
org.tm4j.topicmap.outputMessages generated when writing topic maps to XTM file format.