Occasionally, you may want to separate a part of logging to a separate logging file. That way, you can instantly separate the desired logging from the main logging flow, leaving the original logging configuration untouched. In this recipe, we will define a custom logfile so that only the information we want to gather will be collected. The rest of the configuration will remain intact.
For completing this recipe, you'll need a BPEL process. Any BPEL process is suitable, and of course, we need a running Oracle SOA Suite server.
The following steps will describe how to configure the custom logfile through the Oracle SOA Enterprise Manager Console:
custom-handler
is now listed in the table of logfiles. There is no need to restart the server.The location of the logging configuration for the Oracle SOA Suite is held in the ${domain.home}configfmwconfigserversAdminServer
directory. More precisely, the file containing the logging information is named logging.xml
. Let's check the configuration file. The changes we made through the Oracle Enterprise Manager Console appeared in the following files:
<log_handler name='custom-handler' class='oracle.core.ojdl.logging.ODLHandlerFactory' level='NOTIFICATION:32'> <property name='useDefaultAttributes' value='false'/> <property name='format' value='ODL-Text'/> <property name='path' value='${domain.home}/servers/${weblogic.Name}/logs/customLogFile.log'/> <property name='useSourceClassAndMethod' value='TRACE:1'/> </log_handler>
In the preceding code, with the name
attribute of the <log_handler>
element, we define the name of the log handler. With the format
property, we define the format of the logging data to be used. We can choose either text or XML format. With the path
property, we define the location of the logfile. With the useSourceClassAndMethod
property, we define the logging level to be used for logging information.
<logger name='oracle.soa.bpel.engine.xml'> <handler name='custom-handler'/> </logger>
Logging in the Oracle SOA Suite is based on Java Logging functionality. Although the configuration itself is separated, there is nothing stopping you from using Java Logging elements.
Now that we have logging configured, it is time to start an instance of the BPEL process to check what gets logged. We have set the logging level to TRACE
, so we should get quite a verbose output in the custom logfile. You can run the BPEL process from Assigning date or time to the variables recipe defined in Chapter 7, Accessing and Updating the Variables. By examining the logfiles, you will see the following lines of code (the beginning of the lines are truncated for better readability):
[SRC_METHOD: evaluate] XPathQuery[xp20:current-time()], XPath Result is: 13:05:32.429+02:00 [SRC_METHOD: evaluate] XPathQuery[xp20:format-dateTime(bpws:getVariableData('FormatDate'), '[D01]/[M01]/[Y0001]')], XPath Result is: 01/05/2013 [SRC_METHOD: evalQuery] evaluate PathQuery[/client:proces sResponse/client:result] on oracle.xml.parser.v2.XMLElement@64feb8
With this output, we are able to identify what evaluations are performed in the BPEL process due to the XML operations.