Configuring applications to use Jakarta Commons Logging

Jakarta Commons Logging provides a simple logging interface and thin wrappers for several logging systems. WebSphere® Application Server supports Jakarta Commons Logging by providing a logger. The support does not change interfaces defined by Jakarta Commons Logging.

Before you begin

The WebSphere Application Server logger is a thin wrapper for the WebSphere Application Server logging facility. The logger name is com.ibm.websphere.commons.logging.WsJDK14Logger. The logger can handle logging objects defined by either of the following:

A logging object is an object that holds logging entry information.

To better understand Jakarta Commons Logging, read Jakarta Commons and the specifications for Java Logging and for Common Base Event. To better understand use of the WebSphere Application Server logger, read Jakarta Commons Logging.

About this task

WebSphere Application Server provides the Jakarta Commons Logging binary distribution in its libraries directory. By default, the product uses the Jakarta Commons Logging LogFactory implementation and JDK14Logger.

最佳作法 最佳作法: The default configuration of Jakarta Commons Logging is stored in the commons-logging.properties file. To specify the factory class to use with Jakarta Commons Logging in an application, provide a file named org.apache.commons.logging.LogFactory, located in META-INF/services directory, that contains the name of the factory class on the first line. This is the configuration mechanism for the JAR file service provider, as defined in JDK 1.3 and later.best-practices

For an application to use the WebSphere Application Server logger, the application must provide its own configuration for the logger. To configure an application to use the WebSphere Application Server logger, complete the steps that follow.

Procedure

  1. Examine Configurations for the WebSphere Application Server logger and determine which configuration best suits your application.
  2. Change your application configuration as needed to enable use of the WebSphere Application Server logger.

Results

After the application starts, Jakarta Commons Logging routes the application's logging output to the WebSphere Application Server logger.

指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:17
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=ttrb_classload_jcl
檔名:ttrb_classload_jcl.html