Monday, March 26, 2012

Oracle BRM JCA Adapter logging on Oracle Application Server

The JCA Resource Adapter supports Java Unified Logging (JUL), which allows the adapter to use the Oracle Application Server logging library.


Follow below instruction to enable BRM JCA Adapter logging:

1. Create directory: $Oracle_home/j2ee/Instance/application-deployments/default/BRMAdapter/logs.

2. Edit $Oracle_home/j2ee/Instance/config/j2ee-logging.xml file in an XML editor.

3. Add following lines under the <log_handlers> element:

  <log_handlers>
  <log_handler name="brm-handler" class="oracle.core.ojdl.logging.ODLHandlerFactory">
  <property name="path" value="Oracle_home/j2ee/oc4j_soa/application-deployments/default/BRMAdapter/logs/BRMAdapterLog.log"/>
  <property name="maxFileSize" value="10485760"/>
  <property name="maxLogSize" value="104857600"/>
  <property name="encoding" value="UTF-8"/>
  <property name="format" value="ODL-TEXT"/>
  </log_handler>
  </log_handlers>

  where,
  o Path specifies the directory in which the adapter creates the log file.
  o maxFileSize specifies the maximum size, in bytes, of the log file. When a log file reaches this limit, a new log  file is generated.
  o maxLogSize specifies the maximum size, in bytes, of the logging directory.
  o encoding must be set to UTF-8.
  o format must be set to ODL-TEXT. This enables you to view the log files directly in the Oracle Application Server control console.

4. Add the following lines under the <loggers> element:

  <loggers>
  <logger name="oracle.tip.adapter.brm" level="LogLevel" useParentHandlers="false">
  <handler name="oc4j-handler"/>
  <handler name="brm-handler"/>
  </logger>

  where LogLevel is set to one of the following:

  o SEVERE to log problems that require attention from the system administrator.
  o WARNING to log actions that should be reviewed and may require action before an error occurs.
  o INFO to log normal actions or events. This includes user operations, such as user log ins, and automatic operations, such as log file rotations.
  o CONFIG to log configuration-related messages.
  o FINE to log trace or debug messages for performance monitoring.
  o FINER to log highly detailed trace or debug message.
  o FINEST to log the most detailed trace or debug messages.

5. Save and close the file.

6. Restart the application server or the J2EE instance.

No comments:

Post a Comment