Could you please provide some additional details as to what kind of event that you are looking at? There are certain configurable event management services available in Developer (Tools > Event Manager).
The event I want to log is from a flow service I am writing. I am using a previously written java service that list files from a specified directory. When the file or directory being searched for cannot be found the java service creates an error. But I do not and probably not allowed to modify this existing list files java code to perform another action. So I would like to pick up the exception generated by not being able to find the directory/file and write this error to the webMethods error or server logs.
Hope this is all not too confusing.
The java service uses the java API “File(filePath)”, when the file/directory is not found it throws an exception, which I am trying to capture in webMethods flow code and write this error in the webMethods server and error logs.
To put in error log you can use Exist step signaling Failure and put message in Failure Message property of the step. You can use variable substitution in this failure message i.e. %lastError/error%
I think what Ajit suggested was about the “Exit” step. Might be a typo.
For logging a message to server logs, the pub.flow:debugLog service can be used before the exit step in the catch block with the exact message as input. So once an exception has been raised from the above mentioned java service, it can be handled in the catch block by first logging it to the server log and then to the error log. Hope this helps.
Exit step would create an unwanted email through IS thread.
Instead try using ‘throwException’ service (in PS Utilities package) that would log into the error log with appropriate message. Alternatively, if you have a DB as error log, I would use an adapter service to insert data.
Create a flow service, use try catch, and call your java service in try…
Sequence (exit on success)
Sequence (exit on failure) TRY
Call java service
Sequence (exit on done) CATCH
Call getLastError retrieves the last error
Call debugLog logs the error to server.log file
Logging to the server and error log should be reserved for technical issues only. Writing errors when a particular file is not found sounds to me like an exception relevant to your business logic. In such cases, write to either a database, or a log file outside your webMethods directory or some monitoring facility.
The debugLog service is, as the name implies, for debugging use only. Never use this for anything else and certainly not in production code.
i have a user defined log file outside my webMethods directory for special purpose(say xyz.log)
Now the think is, i want to create a new tab in WMIS logs submenu tab (say pqr)
and i want to show the recent entries of xyz.log file when a user clicks on pqr tab in WMIS(creating a new dsp page - say pqr.dsp)
i am able to create the pqr tab in WMIS
But i am not able to findout a Wm service which can read a userdefined log file and which can show entries in a dsp page.
If you will look at \packages\WmRoot\pub\log-server-recent.dsp file you will get what you are looking for .It has used couple of server related services from the wmRoot package which you can also use to design the custom dsp page to monitor error.