Wednesday, September 1, 2010

Generating custom logs with Log4J within Java Embedding activity

To generate custom logs within a BPEL process using a Java Embedding activity and Log4J do the following steps:
  • Copy log4j-1.2.15.jar to <oss_home>/soa/modules/oracle.soa.ext_11.1.1 and execute ANT script in this directory. This will recreate the oracle.soa.ext.jar file adding the log4j lib to the classpath.
  • Create a new folder for Log4j configuration and log files: <middleware_home>/config, for example
    • add to this folder the configuration files (log4j.debug.xml and log4j.dtd, for example)
    • set the log file name and path (<middleware_home>/config/customErrorLog.log, for example) in the log4j.debug.xml
  • Change the startManagedServer script to point to Log4j configuration file: JAVA_OPTIONS="-Dlog4j.configuration=file:<middleware_home>/config/log4j.debug.xml”
  • Restart the SOA managed server.
From a BPEL development perspective, what is necessary to do is:
  • Import the log4j-1.2.15.jar to the project libs (right click in the project name and select “Project Properties”, go to “Libraries and Classpath” and add the jar file)
  • Insert a Java Embedding activity
  • In the BPEL source code, import the Logger class adding the code below before the “bpelx:exec” created for the Java Embedding component
  • <bpelx:exec import="org.apache.log4j.Logger">
  • Edit the Java Embedding activity and insert the necessary log instructions like:
  • Logger logger = Logger.getLogger("myCustomLog");">>>> Message log for instance: " + getTitle());

To download the Log4j configuration files together with a Composite with a sample use of the log, click here.


  1. very interesting. They say that addAuditTrailEntry is very heavy, so using log4j might prove very effective

  2. Hi,

    how can we implement the same in bpel 10g.
    It would be great if you throw some light.


  3. A cash enhance unit of activity typically a add of cash borrowed against your borrowing limit. You’ll be ready to suspend a cash enhance really mixture of the design throughout that. First, by payday loans exploitation you’re PIN at associate ATM. Or, you may be ready to use a convenience guarantee your credit score cards supplier sent to you.

  4. Cash land created my life easier. once I needed cash to pay off some expenses, cash land was the payday loan sole real one to assist state. obtaining associate automatic headline loan at cash land was easier than preparing to a establishment.

  5. The requirement for brisk cash is sometimes symptomatic the implies that larger administration payday loans issue, like overspending or the act of a just-in-case account. In cases like these, reimbursing a cash credit may take quite whereas and expense a substantial live of cash.

  6. They seldom see actual money. unit budgets don't seem to be usually explained and living among their suggests that may be a remote subject. kids alliance auto title loan rates chicago agency often came back spite of they asked for or ne'er detected the principle on why their individuals same 'no' will not have the most effective understanding of needs and needs.

  7. You may apply for a loan and expect the funds to be in your bank account really} terribly matter of hours. No ancient bank can match that speed of enabling a loan. sometimes come-at-able because of net procedures for getting and disbursing the loans. The recipient merely need to be compelled to refill an internet payday loans corona application, giving some personal details, so stay awake for the loan which is able to come through terribly presently.