Skip Headers

Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g Release 3 (10.1.3) B14428-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Configuring EJB Logging

OC4J uses the standard JDK `java.util.logging` package and, by default, writes log messages to the `<``OC4J_HOME``>/j2ee/home/log/<group>/oc4j/log.xml` file.

This section describes:

- Logging Namespaces

- Logging Levels

- Configuring Logging with Application Server Control Logging MBean

- Configuring Logging Using the j2ee-logging.xml File

- Configuring Logging Using System Properties

## Logging Namespaces

You can configure loggers for the following `java.util.logging` namespaces:

- `oracle.j2ee.ejb.annotation`

- `oracle.j2ee.ejb.compilation`

- `oracle.j2ee.ejb.database`

- `oracle.j2ee.ejb.deployment`

- `oracle.j2ee.ejb.lifecycle`

- `oracle.j2ee.ejb.pooling`

- `oracle.j2ee.ejb.runtime`

- `oracle.j2ee.ejb.transaction`

## Logging Levels

You can configure log levels of: `FINER`, `FINE`, `CONFIG`, `INFO`, `WARNING`, and `SEVERE`.

## Configuring Logging with Application Server Control Logging MBean

The simplest way to configure OC4J logging is to use Application Server Control (see "Using Oracle Enterprise Manager 10g Application Server Control").

Application Server Control shows all EJB-related logger names and you can specify attributes like log level using the Application Server Control interface.

## Configuring Logging Using the j2ee-logging.xml File

You can configure OC4J logging using the `<``OC4J_HOME``>/j2ee/home/config/j2ee-logging.xml` file as Example 31-1 shows.

Example 31-1 j2ee-logging.xml File

    <logger
        name='oracle.j2ee.ejb'
        level='NOTIFICATION:1'
        useParentHandlers='false'>
        <handler name='oc4j-handler'/>
        <handler name='console-handler'/>
    </logger>

For more information, see:

- "Logging Namespaces"

- "Logging Levels"

## Configuring Logging Using System Properties

You can configure OC4J logging using the `oracle.j2ee.logging` system property. This system property has the form:

    oracle.j2ee.logging.<log-level>=<log-namespace>

Where:

- `<log-level>` is one of `fine`, `finer`, or `finest`.

- `<log-namspace>` is an oracle.j2ee.ejb namespace (see "Logging Namespaces").

Example 31-2 shows how to configure the logger for the oracle.j2ee.ejb.deployment namespace to finest.

Example 31-2 Configuring a Logger with a System Property

    oracle.j2ee.logging.finest=oracle.j2ee.ejb.deployment