Send email / react to message being written into ignition's logs

We have a client script running on a machine which isn't actively monitored, which just turns on and off some lights (so not safety critical). However, we'd like to know if there are any issues while the script is running -- such as the serial port closing, or a calculation somehow throwing an unrecoverable exception.

We catch errors and log them to the gateway (through a message handler), but this relies on someone going into the gateway logs every so often to look at them.

Is it an acceptable idea to have the message handler, in addition to writing to the logs, check if the indicated logging level is above a warning, and then act on that (such as sending an email)? Or is there a better way to handle this

You could set a file watcher on the system logs idb and get additions every so often?

Ignition uses Logback, with its configuration stored in data/logback.xml. You can customize the configuration here--it sounds like one option might be adding an SMTPAppender configuration, though I've not ever configured this one myself, YMMV.

Other options (that might require a bit more backing infrastructure) would be to configure log-shipping of Ignition logs to an observability stack that has various facilities for alerting.

4 Likes

That latter was what I meant by file watcher, yes

1 Like