Want to log a string message in gateway diagnostic log from client event Script

want to log a string message in gateway diagnostic log from client event. Please help me out and let me know if this is practically possible or not?

Sounds like your looking for this.

system.util.getLogger - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)

Here am framing my question in a detailed manner as I have already gone through the user manual sir.
I need to see logs in “Gateway Diagnostic Logs”…Whenever I will run my script in client event -
logger = system.util.getLogger(“myLogger”)
logger.info(“Message for Testing”)

I want to see “Message for Testing” in Gateway Diagnostic log whenever the client event startup script will run.

Considering most people replying to your questions on here are other users that are not paid to help in anyway, this response will stop me from helping you any further. Aside from that, you haven’t shown anything to say how your using it. The logger function will created the log entry when applied correctly assuming something else in your code doesn’t stop your script from working. Good luck.

The reason the code you have is not working is that the Gateway Diagnostic Log only show log entries that occur in the Gateway scope and not from the Client Scope. You can use messaging to send logging information back to the gateway scope for logging following the solution in this forum post. [SOLVED] Logging client scoped events to gateway

I was just trying to explain the question in a detailed manner. Many apologize if delivered in the wrong sense. Am glad you answered my question sir.

No necessarily so. The OP (anarula) clearly indicated they wanted a gateway log entry for a client event. Nicoli’s answer is correct. Perspective’s clients use gateway logging, but “client event” has a common meaning: a VIsion Client Event.

Hello everyone,
I found a way to do this let me explain. May be if anyone needs in future.

Step 1 - script on client event
TestingLogsmsg = system.tag.readBlocking(["[System]Client/User/Username"])[0].value
system.tag.writeBlocking(["[default]TestingLogs/TestingLogs 1"],[TestingLogsmsg])

Step 2 - Gateway Event Script
TestingLogsMessage = system.tag.readBlocking(["[default]TestingLogs/TestingLogs 1"])[0].value
logger = system.util.getLogger(“myLogger”)
logger.info(“This Message is for Session Login -” + TestingLogsMessage)

It works for me. Thanks All

I realized it after he replied but I was just starting in on my first coffee of the morning. He changed his reply now but his original reply rubbed me the wrong way so I wasn’t going any further into it. He did apologize after so I’m sure it was nothing but by that point I was off deep into my work. Glad he got it working.

1 Like

I apologized and changed the message. the original message is still in your reply sir.
As i found you offended so changed.
My point was just to explain in a brief manner and to get your valuable suggestions.
And am expecting you already forgive me and hope to see max valuable comments from your side for my future queries.
And my first language is not english…so sometimes i don’t know how to put good sentence… Please ignore :slight_smile: Thanks

1 Like

There isn’t anything to worry about. Text is easy to take the wrong way. That mixed with my need for caffeine to start the morning, I’m sure it wasn’t anything. I’m glad you got what you needed to complete it.