How to log error on Ignition Gateway Console?

Hi. Im trying to log error on Ignition Gateway Console, and I cant.
I use:

try:
   # ...some code...
   pass
except:
     logger =system.util.getLogger('myLogger')
     logger.error('Testing error on logs')
     # ... some code...

I can see the error on Client Diagnostic Logs, but not on Gateway Console Logs. What is the mistake?

Ign version: 7.8.4 (b2016082217)

Thanks.

No mistake, log messages logged in the client or designer don’t get sent to the gateway.

1 Like

If it's available in your version, you can accomplish this by sending a message from the client to the gateway using system.util.sendMessage and then logging it there. See screenshot of gateway message handler in linked post below:

The client sends a message with with loggerName, level, and message and the gateway logs it accordingly.

1 Like