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.Runtime` channel:

    2107  INFO   [main] kodo.Runtime - Starting Kodo 4.0.0

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 will be prepended to all log messages.

- `<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

JPA XML format:

    <property name="kodo.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO"/>

JDO properties format:

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

Example 3.2. Standard Kodo Log Configuration + All SQL Statements

JPA XML format:

    <property name="kodo.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>

JDO properties format:

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

Example 3.3. Logging to a File

JPA XML format:

    <property name="kodo.Log" value="File=/tmp/kodo.log, DefaultLevel=WARN, Runtime=INFO, Tool=INFO"/>

JDO properties format:

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

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