Writing an Arbitrary Message to the Log
To write an arbitrary message to the server log, invoke the pub.flow:debugLog built-in service. You can invoke pub.flow:debugLog from a flow service or a coded service (such as a Java service). When this service executes, it inserts a text string that you specify into the server log. You might use it to post progress messages at certain points in a service (to indicate whether certain segments of code were executed) or to record the value of a particular variable in the log file so you can examine it after the service executes. In the following example, the last two messages are progress messages that were posted to the server log using pub.flow:debugLog.
2012-03-28 16:56:12 EDT [ISS.0028.0005C] Loading LogDemo package
2012-03-28 16:56:53 EDT [ISC.0081.0001E] New LogDemo:demoService
2012-03-28 16:57:56 EDT [ISP.0090.0004C]
begin database update
2012-03-28 16:57:56 EDT [ISP.0090.0004C]
database update completed
To use pub.flow:debugLog to write an arbitrary message to the server log
1. In your service, invoke pub.flow:debugLog at the point where you want the service to write a message to the server log.
2. Set the following parameters:
Key | Description |
message | A String that defines the message that you want written to server log. This can be a literal string. However, for debugging purposes, it is often useful to link this parameter to a pipeline variable whose run-time value you want to capture. |
function | (Optional) A String that identifies your service as the component that posted the message to the log. When displaying the server log, the server lists the String you specify in the second column of the message. Assigning a value to function makes it easier for you to locate your service’s message when you examine the server log. Although you can assign a text string of any length to function, the server displays only the first six characters. If you do not assign a value to function, debugLog omits the label. |
level | (Optional) A String specifying the debug levels under which this message is to be recorded in the log. If the server is running at a debug level lower than the value set in level, the message is not recorded in the log file. If you do not specify level, the Fatal level is assumed, which means that the message is recorded in the log file regardless of which debug level the server is running at. For more information about debug level, see webMethods Integration Server Administrator’s Guide. |
3. Save the service. (If you are using your own IDE, you will need to recompile the service, register it again on Integration Server, and reload its package.)
4. Execute the service.
For additional information about pub.flow:debugLog, see the webMethods Integration Server Built-In Services Reference.