Logging and Alerting
See Also
The Sun BPEL Service Engine provides you with the ability to trace the message or expression values during the process execution. The Logging and Alerting feature make use of standart WS-BPEL extension mechanism. Logging and alerting are supported for almost all BPEL activities.
The IDE provides you with the ability to define logging and alerting for the process activities. Logging is used to write specified expression values or partner links endpoint reference information to the server log. Alerting allows you to receive an alert with this information. After you set the logging or alerting conditions and the BPEL process is executed, specified expression values are written to the server log file or an alert is sent to the user, depending on the log level.
Logging and alerting is defined in the Logging mapper. The Logging mappert is available as a tab from the Design or Source view of the BPEL Process. The Logging mapper consists of the following components:
- Source tree pane. The source tree pane is placed on the left and contains a tree component that provides access to a business process's data variables and partner links. Here a user can choose the variable to be traced.
- Menu Bar. The menu bar provides the operators, necessary elements, and XPath functions used to create the mappings.
The functions usage is very similar to the one in the BPEL Mapper.
- Mapping pane. The mapping pane contains a canvas for creating the mappings.
When you select a function from the menu bar, a function box appears in the mapping pane.
If the function accepts any arguments, then the left side of the function box has one connector for each argument.
If an argument is optional, then a question mark appears after the argument name.
The right side of the function box has one connector for the result.
- Destination tree pane. The destination tree pane is placed on the right and enables the user to choose when the log record will be made and the level of logging.
Defining Logging
When defining logging for an activity you can trace the value of the following components :
In the mappings you can use one or more XPath functions from the menu bar.
To log the variable value:
- On the diagram, select an activity. The logging will be performed in connection with the activity execution.
- Go to the Logging tab of the BPEL Editor. The Logging mapper opens.
You can also open the Logging mapper by right clicking the activity and choosing Go To > Logging (Alt-L).
- In the source tree pane, expand the variables tree until the variable to be traced is visible.
- In the destination tree pane expand the activity node. The nodes designating the moment of logging become visible.
- Choose when the logging entry should be made and expand the appropriate node:
- LOG_onStart. The variable value is written to the log when the activity starts.
- LOG_onComplete. The variable value is written to the log when the activity execution is complete.
- Define the level of logging. Drag the connection from the variable to be traced to the appropriate node in the destination tree pane. The following levels of logging are available:
- Severe
- Warning
- Info
- Config
- Fine
- Finer
- Finest
In the Design view a small icon appears next to the activity with logging defined on it. By clicking the icon you can switch to the Logging mapper.
The entry to the log will be made only if the log level defined for the variable corresponds to the log level specified for the BPEL SE on the application server.
To set the log level for the BPEL SE:
To specify the log level for the BPEL SE, the application server Admin Console is used.
- In the Services window, expand the Servers node. Ensure that the GlassFish application server is running. It has to have a green arrow badge next to it. If the server is not running, right click the server name and choose Start from the context menu.
- Open the Admin Console in your browser. To do this, follow the steps:
- Right click GlassFish V2 application server node, and choose Properties from the context menu. The Servers window opens. On the Servers pane, GlassFish V2 should be selected.
- On the Connection tab, copy the contents of the Location field (by default it is localhost:4848).
- Paste the string to the browser and press Enter. The Sun Java System Application Server Admin Console opens in the browser window.
- Log in to the Admin Console using your username and password. By default, the username is admin and the password is adminadmin.
- On the left pane under the JBI node choose Components > sun-bpel-engine. The BPEL service engine properties page opens.
- On the BPEL service engine properties page, select the Loggers tab. On the Loggers tab you can specify log levels for the individual loggers.
- Choose the appropriate log level for the sun-bpel-engine from the drop down list.
If logging is defined for a process activity, and the log level specified for it corresponds to the log level set for the BPEL SE, after you perform a test run of the process, the selected variable value will be written to the server log file.
Note: The project should be deployed to the application server.
To view the log file:
- In the Services window, under the Servers node, right click GlassFish V2 application server node and choose View Server log from the context menu. TheGlassFish server log opens in the Output window. The activity message value will be included in the log, you can use Search to find it. Note, that some overhead information is hidden.
- You can also open the log in a text editor and see the full information. Navigate to <application server installation directory>/domains/domain1/log/ and open the server.log file with the text editor. The information provided in the log includes the following points, divided with the vertical bar:
- Date and time of the entry
- Log level
- Manager type (for logging this is Trace Manager)
- Thread
- The message value
Here is the sample of the log entry :
[#|2008-03-25T09:26:18.796+0300|INFO|sun-appserver9.1|com.sun.jbi.engine.bpel.core.bpel.trace.BPELTraceManager|_ThreadID=26;_ThreadName=BPELSEInOutThread8;|<?xml version="1.0" encoding="UTF-8"?><jbi:message xmlns:msgns="http://localhost/SynchronousSample/SynchronousSample" name="input1" type="msgns:requestMessage" version="1.0" xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"><jbi:part><syn:typeA xmlns:syn="http://xml.netbeans.org/schema/SynchronousSample">
<syn:paramA>Hello World</syn:paramA>
</syn:typeA></jbi:part></jbi:message>|#]
Defining Alerting
Alerting is defined in a way similar to logging.
When the alerting should be performed and the alerting level for the activity is defined in the Logging mapper.
The way of alerting (e-mail or other) and the alerting level for the BPEL SE is defined on the Sun Java System Application Server Admin Console.
- See Also
- Starting and Stopping a Server
- Performing Test Runs of BPEL Processes
- About Debugging BPEL Processes
Legal Notices