3.5. Apache Commons Logging
Prev | Chapter 3. Logging | Next

## 3.5. Apache Commons Logging

Kodo JDO can use the Apache Jakarta Commons Logging thin library for issuing log messages. The Commons Logging libraries act as a wrapper around a number of popular logging APIs, including the Jakarta Log4J project, and the native java.util.logging package in JDK 1.4. If neither of these libraries are available, then logging will fall back to using simple console logging.

    kodo.Log: commons

When using the Commons Logging framework in conjunction with Log4J, configuration will be the same as was discussed in the Log4J section above.

### 3.5.1. JDK 1.4 java.util.logging

When using JDK 1.4 or higher in conjunction with Kodo's Commons Logging support, logging will proceed through the built-in logging package provided by the java.util.logging package. For details on configuring the built-in logging system, please see the Java Logging Overview.

By default, JDK 1.4's logging package looks in the `JAVA_HOME/lib/logging.properties` file for logging configuration. This can be overridden with the `java.util.logging.config.file` system property. For example:

    java -Djava.util.logging.config.file=mylogging.properties com.company.MyClass

Example 3.5. JDK 1.4 Log Properties

    # specify the handlers to create in the root logger
    # (all loggers are children of the root logger)
    # the following creates two handlers
    handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler

    # set the default logging level for the root logger
    .level=ALL

    # set the default logging level for new ConsoleHandler instances
    java.util.logging.ConsoleHandler.level=INFO

    # set the default logging level for new FileHandler instances
    java.util.logging.FileHandler.level=ALL

    # set the default formatter for new ConsoleHandler instances
    java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter

    # set the default logging level for all Kodo logs
    kodo.Tool.level=INFO
    kodo.Runtime.level=INFO
    kodo.Remote.level=INFO
    kodo.DataCache.level=INFO
    kodo.MetaData.level=INFO
    kodo.Enhance.level=INFO
    kodo.Query.level=INFO
    kodo.jdbc.SQL.level=INFO
    kodo.jdbc.JDBC.level=INFO
    kodo.jdbc.Schema.level=INFO

Prev | Up | Next
3.4. Log4J | Home | 3.6. Custom Log