Event logger

I don’t know if the following is possible with FactorySQL or whether it qualifies as a feature request. An old DOS (!) SCADA package I used many years ago had both time-based logging and event logging. You defined a trigger for an event log and the period of time both before and after an event you wanted to log. When it started running, it filled up the ‘before event’ buffer. It then kept just the amount of data you had specified in the ‘before’ buffer, throwing away older data.

If an event occurred, it saved this buffer and then logged for the time specified in the ‘after event’ buffer. In this way you didn’t fill up your hard disk with unwanted data, but still ended up with data both before and after an event.

A customer asked for this just last week, so I thought I would check if it was possible.


That’s a good idea. Currently, it’s not really available as a built-in feature. You could probably rig up something similar by logging data continuously to the database and then trimming it down periodically based on a separate log of the trigger events. Or a slight modification of this would be to have two tables with the same schema, such as “data_buffer” and “confirmed_data”, and then just periodically insert from the buffer to the confirmed table (“INSERT INTO x SELECT y” - handy sql statement) and delete everything in the buffer.

That said, decent support for this sounds like a good idea.