# Write message in log

**URL:** <https://forum.inductiveautomation.com/t/write-message-in-log/62908>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [August 11, 2022, 7:38am UTC](https://forum.inductiveautomation.com/t/write-message-in-log/62908 "2022-08-11T07:38:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [August 11, 2022, 7:38am UTC](https://forum.inductiveautomation.com/t/write-message-in-log/62908/1 "2022-08-11T07:38:46Z")

</div>

Hello,  
I have a script attach to a tag wich is not working, i would like to print message in the log but when i try it in the script console i have nothing in the log.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/d/bd8a9f65ffaa9e74ae0c5930f1a2dbb555fd62a4.png)  
Do i have to create first the logger named “myLogger”?  
Is there best way to debug script attach to tag?

---

<div class="post-metadata">

**Author:** ![m.pelagatti](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/m.pelagatti/32/68595_2.png) [@m.pelagatti](https://forum.inductiveautomation.com/u/m.pelagatti)\
**Post date:** [August 11, 2022, 7:46am UTC](https://forum.inductiveautomation.com/t/write-message-in-log/62908/2 "2022-08-11T07:46:43Z")

</div>

Read this post:

> [@Creating a log and print function that is not working?](https://forum.inductiveautomation.com/t/creating-a-log-and-print-function-that-is-not-working/42203):
>
> Unsure why this is not working, probably some niche reason I am unaware of. I have two scripts that are involved here, def universalPrint(message): """ Will work for vision or perspective clients now. Args: message: str, what do you want to print Returns: None """ from env import isVision if isVision(): print message else: import system.perspective system.perspective.print(message) This has works fine and has been use in use for a while. My new script which is printing, bu…

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 11, 2022, 4:39pm UTC](https://forum.inductiveautomation.com/t/write-message-in-log/62908/3 "2022-08-11T16:39:21Z")

</div>

And this one:

> [@Event Configuration Print Out to debug](https://forum.inductiveautomation.com/t/event-configuration-print-out-to-debug/60091/5):
>
> It’s complicated slight_smile Starting from most local to least… In the script console, print will log directly to the output buffer on the right hand side. system.util.getLogger() will log to the named ‘Output Console’ Designer window. Bonus: A script invoked from here using system.util.invokeAsync will print to the regular output console, not the buffer on the right hand side. Anywhere else in the designer (except Perspective), print and system.util.getLogger will log to the ‘Out…

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [August 12, 2022, 6:42am UTC](https://forum.inductiveautomation.com/t/write-message-in-log/62908/4 "2022-08-12T06:42:49Z")

</div>

Thank you for your advice, it work!

1. In the script console system.util.getLogger or system.util.logger print in the Output Console:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/9/b9fff6f4af80b225ff79dfe2d7a9146711fe42ad.png)
2. In a script attach to a tag it print well in the gateway log:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/8/88fa0ab339e6b37e58389a5426358f1fcaba89e1.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 12, 2022, 7:14am UTC](https://forum.inductiveautomation.com/t/write-message-in-log/62908/5 "2022-08-12T07:14:39Z")

</div>

> [@pick](#):
>
> Output Console:

fwiw, it also prints into the Designer's Diagnostic viewer as well from Help -\> Diagnostics

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1ed642fe4912b61359ea87059eca33ae705640c.png)

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [August 12, 2022, 7:31am UTC](https://forum.inductiveautomation.com/t/write-message-in-log/62908/6 "2022-08-12T07:31:15Z")

</div>

thanks for the tip 👍
