3.2. Kodo Logging
Prev | Chapter 3. Logging | Next

## 3.2. Kodo Logging

By default, Kodo uses a basic logging framework with the following output format:

millis level [thread name] channel - message

For example, when loading an application that uses Kodo, a message like the following will be sent to the `kodo.MetaData` log channel when Kodo loads JDO metadata about your project:

    2107  INFO   [main] kodo.MetaData - Parsing metadata resource "file:/projects/JDO/test/my/company/package.jdo".

The default logging system accepts the following parameters:

- `File`: The name of the file to log to, or `stdout` or `stderr` to send messages to standard out and standard error, respectively. By default, Kodo sends log messages to standard error.

- `DefaultLevel`: The default logging level of unconfigured channels. Recognized values are `TRACE, DEBUG, INFO, WARN,` and `ERROR` . Defaults to `INFO`.

- `DiagnosticContext`: A string that should be put in the beginning of all log messages issued by this `PersistenceManagerFactory`.

- `<channel>`: Using the last token of the logging channel name, you can configure the log level to use for that channel. See the examples below.

Example 3.1. Standard Kodo Log Configuration

    kodo.Log: DefaultLevel=WARN, Runtime=INFO, Tool=INFO

Example 3.2. Standard Kodo Log Configuration + All SQL Statements

    kodo.Log: DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE

Example 3.3. Logging to a File

    kodo.Log: File=/tmp/kodo.log, DefaultLevel=WARN, Runtime=INFO, Tool=INFO

Prev | Up | Next
Chapter 3. Logging | Home | 3.3. Disabling Logging