You want to say that error returned becouse we used a register_logevent function. Right? I have read a documentation "Scripting Tutorial -> Advanced Topics -> Catching Log Messages" and see the example of use register_event.
I'm understand that you help for me, but my question: why I see error?