UDT - Tag Event Scripts - error log

If there is an error from a SQL stored procedure called in my tag event script (tag value changed),I only see the error in the diagnostic log or in the wrapper file when I applied a change on the script.

When I change the value of my tag, the script is called but the error doesn’t appeared in any log.

Is it a normal behavior ?

@Manuel_Lefebvre, thank you for reaching out on this… It looks like there is a small issue here, where once a given tag event script has gone into error, it stops logging. The intent is to log once upon a script going into error, and not bombard the logger with each execution (you can set tags.eventscripts.dispatcher to DEBUG level to have it log each time as a workaround, though you may also get some other unrelated “chatter” as a result).

Unfortunately, looking into this, it doesn’t look like there is a good reset of this in-error condition once it is set (other than committing/re-saving the script). We’re going to file a ticket on this on our side.

1 Like

I have the same issue with debugging a tag event script that is executing a Sepasoft MES operation. the code in the event has full try except raise final. I found the chatter from setting the dispatcher to DEBUG excessive so I am making fake edits to the code to get the error from the Sepasoft call to commit to the logs when raised

another alternative is to send str(sys.exc_info()) to the log. that will at least give you an abbreviated Python version of the error

Or you can use PythonAsJavaException() from later.py to send a full python backtrace to the log.

1 Like