The ExtendedLogListener component watches the Process Execution Engine log file and triggers an event when a new log message is generated. The ExtendedLogListener 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 Fuego.Msg.LogMessage and contains the complete log message information.
If you need to retrieve only the log message text or limit the type of log message to handle in the listening PBL, use the Fuego.Msg.ServerLogListener component.
In the following example, all log messages 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 LogMessage) is the argument
// variable received by the listening script
writeLineTo logsFile
using "\nLog Message from listening PBL: " +
message.message +
"\nModule: " + message.module +
"\nSeverity: " + message.severity
end
close logsFile
end