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

**URL:** <https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081>\
**Category:** Ignition\
**Created:** [November 15, 2021, 3:26pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081 "2021-11-15T15:26:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anarula](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@anarula](https://forum.inductiveautomation.com/u/anarula)\
**Post date:** [November 15, 2021, 3:26pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/1 "2021-11-15T15:26:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [November 15, 2021, 3:31pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/2 "2021-11-15T15:31:05Z")

</div>

Sounds like your looking for this.

[system.util.getLogger - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/system.util.getLogger)

---

<div class="post-metadata">

**Author:** ![anarula](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@anarula](https://forum.inductiveautomation.com/u/anarula)\
**Post date:** [November 15, 2021, 3:52pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/3 "2021-11-15T15:52:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [November 15, 2021, 4:00pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/4 "2021-11-15T16:00:05Z")

</div>

> [@anarula](#):
>
> Here am repeating my question again?

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.

---

<div class="post-metadata">

**Author:** ![nicoli.liedtke](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nicoli.liedtke](https://forum.inductiveautomation.com/u/nicoli.liedtke)\
**Post date:** [November 15, 2021, 4:08pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/5 "2021-11-15T16:08:28Z")

</div>

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](https://forum.inductiveautomation.com/t/solved-logging-client-scoped-events-to-gateway/37330)

---

<div class="post-metadata">

**Author:** ![anarula](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@anarula](https://forum.inductiveautomation.com/u/anarula)\
**Post date:** [November 15, 2021, 4:13pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/6 "2021-11-15T16:13:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 15, 2021, 6:16pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/7 "2021-11-15T18:16:15Z")

</div>

> [@bpreston](#):
>
> The logger function will created the log entry

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.

---

<div class="post-metadata">

**Author:** ![anarula](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@anarula](https://forum.inductiveautomation.com/u/anarula)\
**Post date:** [November 15, 2021, 6:23pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/8 "2021-11-15T18:23:56Z")

</div>

## 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

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [November 15, 2021, 6:51pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/9 "2021-11-15T18:51:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anarula](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@anarula](https://forum.inductiveautomation.com/u/anarula)\
**Post date:** [November 15, 2021, 7:13pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/10 "2021-11-15T19:13:02Z")

</div>

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 🙂 Thanks

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [November 15, 2021, 7:26pm UTC](https://forum.inductiveautomation.com/t/want-to-log-a-string-message-in-gateway-diagnostic-log-from-client-event-script/53081/11 "2021-11-15T19:26:49Z")

</div>

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.
