log-stdout Configuring the Oracle CEP Logging Service

Configuring Logging and Debugging for Oracle CEP 15-13 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dlog4j.configuration=URLlog4j.properties Another very useful command line property is -Dlog4j.debug=true. Use this property when log4j output fails to appear or you get cryptic error messages.

15.3.4 Debugging Log4j Logging

If log4j output fails to appear or you get cryptic error messages, consider using the command line property -Dlog4j.debug=true on the command line. For more information, see Section 15.3.3, Enabling Log4j Logging .

15.4 Using the Apache Commons Logging API

You can use Apache Commons logging API in your Oracle CEP applications to log application-specific messages to the Oracle CEP server.log and consoleoutput.log files. To use the commons logging API: 1. Set the system property org.apache.commons.logging.LogFactory to weblogic.logging.commons.LogFactoryImpl. This LogFactory creates instances of weblogic.logging.commons.LogFactoryImpl that implement the org.apache.commons.logging.Log interface. 2. From the LogFactory, get a reference to the Commons Log object by name. This name appears as the subsystem name in the log file. 3. Use the Log object to issue log requests to logging services. The Commons Log interface methods accept an object. In most cases, this will be a string containing the message text. The Commons LogObject takes a message ID, subsystem name, and a string message argument in its constructor. See org.apache.commons.logging at http:jakarta.apache.orgcommonsloggingapiindex.html . 4. The weblogic.logging.commons.LogImpl log methods direct the message to the server log. Example 15–4 Commons Code Example import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; public class MyCommonsTest { public void testCommonsLogging { System.setPropertyLogFactory.FACTORY_PROPERTY, weblogic.logging.commons.LogFactoryImpl; Log clog = LogFactory.getFactory.getInstanceMyCommonsLogger; Log String objects clog.debugHey this is common debug; clog.fatalHey this is common fatal, new Exception; clog.errorHey this is common error, new Exception; clog.traceDont leave your footprints on the sands of time; } }