Fuego.Msg : ServerLogListener

The ServerLogListener component watches the Process Execution Engine log file and triggers an event when a new log message is generated. The ServerLogListener component must be used as the listener component of a Global Automatic.

Each time a log message is posted, the listening PBL script in the Global Automatic is executed. The PBL script receives the message argument variable, which is of type String and contains the text of the log message.

If you need to retrieve additional attributes from each log message, such as its priority or severity, use the Fuego.Msg.ExtendedLogListener component.

ServerLogListener Parameters

The ServerLogListener component takes the following parameters for initialization. Only log messages that match the following properties will trigger the listening PBL. These properties correspond to the columns that appear in the Log Viewer application:

Parameter Required? Description
severities no Log message severity (such as Debug, Info, Warning, Severe, and Fatal).
modules no The module of the Oracle BPM system that is generating this message. For example: Main.
detailLevel no An integer from 1 to 10. Higher values provide more details.
clientSeverities no Contains the same values as severities. This parameter applies to log messages generated using the logMessage PBL statement. It does not apply to log messages generated by the core Oracle BPM system.

Example: Initialization

Following is an example for the Global Automatic initialization script. In the example, componentArguments is a predefined variable where initialization values are passed to the component:

componentArguments = [
    "severities"   : "warning,severe",
    "clientSeverities" : "info,warning,severe",
    "modules"      : "all",
    "detailLevel"  : "10"
]

Example: Processing a Log Message Event

In the following example, all log messages that are generated for the current business process are written to a file. You would add the following code to the listening PBL script of the Global Automatic:

if message.processId == Process.id then 

  logsFile = TextFile()
   
  openForWriting logsFile
      using name = "c:/tmp/testfile.txt",
          append = true
   
    // "message" (of type String) is the argument
    // variable received by the listening script
    writeLineTo logsFile
      using "\nLog Message from listening PBL: " +
          message
  end
   
  close logsFile
end
Related reference
../ExtendedLogListener/ExtendedLogListener_component.html#reference56