Question

Question on the use of the LogMessageStreamer in 2016

  • 16 December 2017
  • 8 replies
  • 8 views

Badge

Does anyone know how best to use the 'LogMessageStreamer' transformer in FME to capture all logging errors. I know it has to run at the end of the Workspace to do this but as it has no input it is difficult to do this even when you set the run order to be last. I have also tried to make sure it is the last transformer I add to the Workspace but when I look at the log file after a run it has not been executed last, so if an error occurs after this it will not pick up the errors or failures from the Workspace run. I need to do this because these Workspaces are scheduled on FME Server and we need to know if something is failing over the weekend and keep a record of the errors or failures without going through lots of log files on the Server. This transformer is the perfect one to use for my purpose if it could pick up all the errors during a Workspace run as some of these errors do not necessarily terminate the Workspace. I am trying to be a bit more sophisticated with the capturing of errors in my Workspaces instead of just going to a terminator or logger. Many thanks for your help or advice on this in advance. John


8 replies

Userlevel 4

Try right-clicking on the LogMessageStreamer and select "Set Creator runtime order" from the bottom of the dropdown menu. Make sure the LogMessageStreamer comes first:

Badge

Hi @david_r, I thought it had to be set to run last in order to pick up all the errors in the Workspace run?

Userlevel 4

I don't think so, at least there's no mention in the documentation.

Just be aware of the following notice in the doc:

Limitations: Messages outside the lifetime of the transformer cannot be captured.

So I think that Safe could be a bit clearer about what exactly constitutes the "lifetime of the transformer", but as I understand it, it basically means that the transformer won't capture the very first and the very last lines of the FME log window. If you really need the entire log file, you'll have to read it back manually after the workspace has termintated.

Userlevel 2
Badge +17

According to my observation, the LogMessageStreamer collects log messages which have been logged BEFORE the transformer starts outputting the features containing those messages.

In this workspace, for example, the LogMessageStreamer outputs the messages logged by the PythonCreator that runs first. However, it outputs nothing if the Terminator is enabled.

logmessagestreamer-demo.fmw (FME 2017.0.1.1)

Badge

Hi @david_r, In takashi demo fme if the logmessagestreamer is set to run first you get nothing but if it runs last you get 10 features output.

Badge

Hi to all,

I have a strange behaviour with LogMessageStreamer... I had the transformer in the workbench, I've added some logger but when the workbench end my logmessagestreamer don't collect anything because for some strange reasons is executed before the ending of thescript.

I've tried the suggestion of @david_r but with no results. Why the LogMessageStreamer isn't the last transformer executed in the workbench? (fme 2018.1).

 

Thanks for suggestions

 

Badge +2

Hi to all,

I have a strange behaviour with LogMessageStreamer... I had the transformer in the workbench, I've added some logger but when the workbench end my logmessagestreamer don't collect anything because for some strange reasons is executed before the ending of thescript.

I've tried the suggestion of @david_r but with no results. Why the LogMessageStreamer isn't the last transformer executed in the workbench? (fme 2018.1).

 

Thanks for suggestions

 

Hi @giosp,

The LogMessageStreamer works in the same way as the Creator transformers and does not necessarily start at the End of the translation, I suspect your workspace contains blocking transformers, in which case once features hit a blocking transformer the next creator, or in your case, LogMessage Streamer is triggered to run, and of course it cannot capture any information that has not been logged yet.

I believe this idea: Transformer that works after Completion of Translation addresses your concerns so please consider adding your vote and any comments you think may be helpful.

In order to workaround this limitation I suggest wrapping the Log Message Streamer up as a custom transformer - this way it can have an input port so you can tie it in with your existing translation, forcing it to run after the rest of the translation is completed.

Please see the example workspace attached to demonstrate how this would work.

logmessagestreamerworkaround.fmw

Badge

Hi @giosp,

The LogMessageStreamer works in the same way as the Creator transformers and does not necessarily start at the End of the translation, I suspect your workspace contains blocking transformers, in which case once features hit a blocking transformer the next creator, or in your case, LogMessage Streamer is triggered to run, and of course it cannot capture any information that has not been logged yet.

I believe this idea: Transformer that works after Completion of Translation addresses your concerns so please consider adding your vote and any comments you think may be helpful.

In order to workaround this limitation I suggest wrapping the Log Message Streamer up as a custom transformer - this way it can have an input port so you can tie it in with your existing translation, forcing it to run after the rest of the translation is completed.

Please see the example workspace attached to demonstrate how this would work.

logmessagestreamerworkaround.fmw

Thank you @hollyatsafe, I will check the custom transformer.

Reply