# Output is not printing on the console

**URL:** <https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855>\
**Category:** General Discussion\
**Created:** [February 2, 2018, 8:30pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855 "2018-02-02T20:30:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [February 2, 2018, 8:30pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/1 "2018-02-02T20:30:00Z")

</div>

Hello All:  
I’ve written a script for a tag whenever there is a value change. I am trying to print new value on the console, but it is not working. Please check the code below and let me know if I am doing anything wrong

print “New Value for %s: %s:” %(tagPath,currentValue)

Thanks,  
Shwetha.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [February 2, 2018, 8:34pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/2 "2018-02-02T20:34:05Z")

</div>

Define console? What scope? Gateway or Client/Designer. If you are looking for a more reliable way to log thins, use system.util.getLogger()

Also, as a side note,have you had a chance to complete Inductive University yet? I believe this is answered there.

---

<div class="post-metadata">

**Author:** ![rdelossantos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rdelossantos/32/4608_2.png) [@rdelossantos](https://forum.inductiveautomation.com/u/rdelossantos)\
**Post date:** [February 2, 2018, 8:34pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/3 "2018-02-02T20:34:33Z")

</div>

Hi @shwethag,

Tag event scripts cannot print into the console. Instead, you have to print in the log of the Gateway:

> logger = system.util.getLogger("myLogger")  
> logger.info("New Value for %s: %s:" %(tagPath,currentValue.value))

Note that currentValue is a "qualified value", so you need to specify you want to get the value as I did in the example above

---

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [February 2, 2018, 8:37pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/4 "2018-02-02T20:37:05Z")

</div>

Thanks Kyle:  
I was referring the user manual. The code I mentioned in the question is a copy from the example given in the user manual for “value change event” for a tag.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [February 2, 2018, 8:39pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/5 "2018-02-02T20:39:04Z")

</div>

Yeah, the would log to the gateway. You need to use system.util.getLogger().

---

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [February 2, 2018, 8:39pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/6 "2018-02-02T20:39:41Z")

</div>

> [@rdelossantos](#):
>
> logger = system.util.getLogger("myLogger")logger.info("New Value for %s: %s:" %(tagPath,currentValue.value))

Thank you.  
I'll try this. I followed the example given in the user manual. I wonder why is it mentioned in the manual if is not possible to print it on the console.

---

<div class="post-metadata">

**Author:** ![rdelossantos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rdelossantos/32/4608_2.png) [@rdelossantos](https://forum.inductiveautomation.com/u/rdelossantos)\
**Post date:** [February 2, 2018, 8:41pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/7 "2018-02-02T20:41:40Z")

</div>

Where are you looking at? This is the example I see in the user manual:

> # This script will fetch all of the possible parameters in the tag changed script.
> 
> # Note that this will not print out to the console, but it will print to the wrapper logs located on the gateway.
> 
> path = tagPath  
> prev = previousValue  
> cur = currentValue  
> init = initialChange  
> missed = missedEvents  
> print path, prev.value, cur.quality, init, missed

Read carefully the second comment (Note that this will not print out to the console, but it will print to the wrapper logs located on the gateway.)

---

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [February 2, 2018, 8:42pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/8 "2018-02-02T20:42:48Z")

</div>

> [@shwethag](#):
>
> logger = system.util.getLogger("myLogger")logger.info("New Value for %s: %s:" %(tagPath,currentValue.value))

[https://docs.inductiveautomation.com/display/DOC79/Scripting+in+Ignition](https://docs.inductiveautomation.com/display/DOC79/Scripting+in+Ignition)

---

<div class="post-metadata">

**Author:** ![rdelossantos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rdelossantos/32/4608_2.png) [@rdelossantos](https://forum.inductiveautomation.com/u/rdelossantos)\
**Post date:** [February 2, 2018, 8:47pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/9 "2018-02-02T20:47:05Z")

</div>

Yeap. This can be confusing for new users. Actually it says _Because these events are on Tags, they are Gateway Scoped._ so the example in the screenshot is the worst one they could chose I guess 😛

---

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [February 2, 2018, 8:53pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/10 "2018-02-02T20:53:43Z")

</div>

Aww… could you please let me know where to look in detail. There is so much info. I get lost sometimes.

Thanks,  
Shwetha.

---

<div class="post-metadata">

**Author:** ![rdelossantos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rdelossantos/32/4608_2.png) [@rdelossantos](https://forum.inductiveautomation.com/u/rdelossantos)\
**Post date:** [February 2, 2018, 9:05pm UTC](https://forum.inductiveautomation.com/t/output-is-not-printing-on-the-console/16855/11 "2018-02-02T21:05:43Z")

</div>

Just go to your Gateway \> Status and in the left panel, you will find Logs below Diagnostics
