# Unable to see Logs in gateway

**URL:** <https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151>\
**Category:** Ignition\
**Created:** [May 12, 2025, 4:28pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151 "2025-05-12T16:28:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 12, 2025, 4:28pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/1 "2025-05-12T16:28:59Z")

</div>

Hi,

I want to print the logs in gateway logs/gateway console to debug the code, but somehow I am unable to see these logs in gateway or gateway console.  
I am doing it like below, please let me know what I am doing wrong here.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/e/ae7b89e9729fd1df510e42610890f2d0fb5dceac.png)

Thanks,  
Anita

---

<div class="post-metadata">

**Author:** ![patrixmith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrixmith/32/75926_2.png) [@patrixmith](https://forum.inductiveautomation.com/u/patrixmith)\
**Post date:** [May 12, 2025, 4:34pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/2 "2025-05-12T16:34:22Z")

</div>

You need to create the `LoggerEX` object first.

```python
log = system.util.getLogger("Anita's Logger")
log.tracef("Calling replicateCallback..... ")
...

```

---

<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:** [May 12, 2025, 4:40pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/3 "2025-05-12T16:40:39Z")

</div>

If that is a project library script, do the `...getLogger()` assignment **outside** the function, so it will be cached.

Do **not** use `print` in gateway scope at all, unless you have easy admin access to the wrapper log file(s).

Edit: Uhm, the use of `event.source` indicates this is Vision Client scope. Those only log to the local diagnostics page, not to the gateway.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 12, 2025, 4:44pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/4 "2025-05-12T16:44:45Z")

</div>

its already created.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/4/846df55f0c27404597f4669892027c1a90ae6fbe.png)

---

<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:** [May 12, 2025, 4:48pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/5 "2025-05-12T16:48:06Z")

</div>

How are we supposed to know that?

Post your **whole** code, **where** it's being executed, and more information about what's going wrong, or no one will be able to help you, because you haven't provided enough information.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 12, 2025, 4:56pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/6 "2025-05-12T16:56:29Z")

</div>

I am trying to replicate the tags, I designer I have one button and we are using external python.

here is the button code in designer. I can see the print statements from button code.

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

here is one py file from here I am calling replicatecallback(),

this is the code upto replicatecallback function,

import system, sys, traceback, time  
from ils.io.util import getTagExpression, getTagSQL, getUDTType, getTagScript, readTag, writeTag, isFolder, stripProvider  
from ils.common.cast import listToDataset

COMMAND\_TAG\_PATH = "[Client]Replicate/Command"  
DESTINATION\_TAG\_PROVIDER\_TAG\_PATH = "[Client]Replicate/Destination Tag Provider"  
DUMP\_TAGS\_TAG\_PATH = "[Client]Replicate/Dump Tags"  
SELECTED\_TAG\_PATH\_TAG\_PATH = "[Client]Replicate/Selected Tag Path"  
STATUS\_TAG\_PATH = "[Client]Replicate/Status"  
TAG\_COUNTER\_TAG\_PATH = "[Client]Replicate/Tag Counter"  
TOTAL\_TAG\_COUNT\_TAG\_PATH = "[Client]Replicate/Total Tag Count"  
REPLACE\_EXPRESSION\_TAGS\_TAG\_PATH = "[Client]Replicate/Replace Expression Tags"  
REPLACE\_QUERY\_TAGS\_TAG\_PATH = "[Client]Replicate/Replace Query Tags"

ABORT\_COMMAND = "Abort"  
from ils.util.logging import getLogger  
log = getLogger( **name** )

# log = system.util.getLogger( **name** )

def internalFrameOpened(rootContainer):  
log.infof("In %s.internalFrameOpened()", **name** )  
projectName = system.util.getProjectName()  
messageHandler = "getGatewayTagProviders"  
tagProviders = system.util.sendRequest(projectName, messageHandler, scope = "G")  
tagProviders.remove("System")  
ds = listToDataset(tagProviders)  
ds = system.dataset.sort(ds, 0)  
rootContainer.TagProviders = ds  
rootContainer.ShowPreferences = False

```
reset()

```

def abortCallback(event):  
writeTag(COMMAND\_TAG\_PATH, ABORT\_COMMAND)

def resetCallback(event):  
reset()

def reset():  
log.infof("In %s.reset()", **name** )  
writeTag(COMMAND\_TAG\_PATH, "")  
writeTag(STATUS\_TAG\_PATH, "")  
writeTag(TOTAL\_TAG\_COUNT\_TAG\_PATH, 0)  
writeTag(TAG\_COUNTER\_TAG\_PATH, 0)

def replicateCallback(event):  
log.tracef("Calling replicateCallback..... ")  
log.infof("Calling replicateCallback..... ")  
print "Calling replicateCallbackkkkkkkk..... "  
rootContainer = event.source.parent  
okToProceed, sourceTagProvider, destinationTagProvider, sourceTagTree, selectedTagPath = checkSelections(rootContainer)  
log.infof('okToProceedddddddddd %s',okToProceed)  
log.tracef('okToProceedddddddddd %s',okToProceed)  
if not(okToProceed):  
return

```
writeTag(SELECTED_TAG_PATH_TAG_PATH, selectedTagPath)
writeTag(DESTINATION_TAG_PROVIDER_TAG_PATH, destinationTagProvider)

writeTag(COMMAND_TAG_PATH, "Replicate")

```

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 12, 2025, 4:58pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/7 "2025-05-12T16:58:08Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/2329fc843c13b0b43369aa2b09bf78ec1589b549.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c66f06ea92f2efc64e1c26dad0e2ff5b77470307.png)

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 12, 2025, 4:58pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/8 "2025-05-12T16:58:10Z")

</div>

Please edit your post to provide your code as preformatted text. See [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).  
You can edit your post by clicking the pencil Icon in the lower right of your post.

Also, if this is being run in a vision client then you will not see these logs in the gateway log, only the local client log.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 12, 2025, 5:12pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/9 "2025-05-12T17:12:05Z")

</div>

I am unable to format the code, can you please help me by referring above two screenshots?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 12, 2025, 6:27pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/10 "2025-05-12T18:27:11Z")

</div>

> [@Anita.Shinde](#):
>
> def internalFrameOpened(rootContainer):  
> log.infof("In %s.internalFrameOpened()", **name** )  
> projectName = system.util.getProjectName()  
> messageHandler = "getGatewayTagProviders"  
> tagProviders = system.util.sendRequest(projectName, messageHandler, scope = "G")  
> tagProviders.remove("System")  
> ds = listToDataset(tagProviders)  
> ds = system.dataset.sort(ds, 0)  
> rootContainer.TagProviders = ds  
> rootContainer.ShowPreferences = False

> **Project Library Script**
>
> ```python
> import system, sys, traceback, time
> from ils.io.util import getTagExpression, getTagSQL, getUDTType, getTagScript, readTag, writeTag, isFolder, stripProvider
> from ils.common.cast import listToDataset
> 
> COMMAND_TAG_PATH = "[Client]Replicate/Command"
> DESTINATION_TAG_PROVIDER_TAG_PATH = "[Client]Replicate/Destination Tag Provider"
> DUMP_TAGS_TAG_PATH = "[Client]Replicate/Dump Tags"
> SELECTED_TAG_PATH_TAG_PATH = "[Client]Replicate/Selected Tag Path"
> STATUS_TAG_PATH = "[Client]Replicate/Status"
> TAG_COUNTER_TAG_PATH = "[Client]Replicate/Tag Counter"
> TOTAL_TAG_COUNT_TAG_PATH = "[Client]Replicate/Total Tag Count"
> REPLACE_EXPRESSION_TAGS_TAG_PATH = "[Client]Replicate/Replace Expression Tags"
> REPLACE_QUERY_TAGS_TAG_PATH = "[Client]Replicate/Replace Query Tags"
> 
> ABORT_COMMAND = "Abort"
> from ils.util.logging import getLogger
> log = getLogger(name)
> #log = system.util.getLogger(name)
> 
> def internalFrameOpened(rootContainer):
> log.infof("In %s.internalFrameOpened()", name)
> projectName = system.util.getProjectName()
> messageHandler = "getGatewayTagProviders"
> tagProviders = system.util.sendRequest(projectName, messageHandler, scope = "G")
> tagProviders.remove("System")
> ds = listToDataset(tagProviders)
> ds = system.dataset.sort(ds, 0)
> rootContainer.TagProviders = ds
> rootContainer.ShowPreferences = False
> 
> def abortCallback(event):
> writeTag(COMMAND_TAG_PATH, ABORT_COMMAND)
> 
> def resetCallback(event):
> reset()
> 
> def reset():
> log.infof("In %s.reset()", name)
> writeTag(COMMAND_TAG_PATH, "")
> writeTag(STATUS_TAG_PATH, "")
> writeTag(TOTAL_TAG_COUNT_TAG_PATH, 0)
> writeTag(TAG_COUNTER_TAG_PATH, 0)
> 
> def replicateCallback(event):
> log.tracef("Calling replicateCallback..... ")
> log.infof("Calling replicateCallback..... ")
> print "Calling replicateCallbackkkkkkkk..... "
> rootContainer = event.source.parent
> okToProceed, sourceTagProvider, destinationTagProvider, sourceTagTree, selectedTagPath = checkSelections(rootContainer)
> log.infof('okToProceedddddddddd %s',okToProceed)
> log.tracef('okToProceedddddddddd %s',okToProceed)
> if not(okToProceed):
> return
> 
> writeTag(SELECTED_TAG_PATH_TAG_PATH, selectedTagPath)
> writeTag(DESTINATION_TAG_PROVIDER_TAG_PATH, destinationTagProvider)
> 
> writeTag(COMMAND_TAG_PATH, "Replicate")
> 
> ```

Also, you are in a project library script, don't `import system`, its available by default.

In your event script on the component don't use `import`, just do a single line call to the project library script function, like so: `ils.common.tagReplicator.replicateCallback(event)`

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 12, 2025, 7:08pm UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/11 "2025-05-12T19:08:06Z")

</div>

> [@Anita.Shinde](#):
>
> I am unable to format the code

Did you read the linked post [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831)? Please try again.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 13, 2025, 8:22am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/12 "2025-05-13T08:22:05Z")

</div>

its not a project library, we are using external python here.  
python code or replicatecallback() is outside the designer, because of that we are importing that library and then calling that function.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 13, 2025, 8:54am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/13 "2025-05-13T08:54:49Z")

</div>

Well you can't be surprised that you don't see the logs in the gateway then...

What are you doing in this external script that you can't do in ignition ?

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 13, 2025, 10:34am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/14 "2025-05-13T10:34:07Z")

</div>

yes we can do it in ignition as well.  
But its our work practice to write a code in external python file for version control.  
Earlier I was able to see the logs in gateway, but now I did not understand why it is not showing.  
I upgraded my code, earlier I was using ils.log now I am using ils.util.logger  
is there anything I need to change in gateway configurations after changing the logger?

---

<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:** [May 13, 2025, 11:18am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/15 "2025-05-13T11:18:32Z")

</div>

> [@Anita.Shinde](#):
>
> I am using ils.util.logger

I don't see this function mentioned anywhere in your posted code...

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 13, 2025, 11:29am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/16 "2025-05-13T11:29:52Z")

</div>

okay, let me check

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 13, 2025, 11:44am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/17 "2025-05-13T11:44:37Z")

</div>

This whole thread seems to have missed that you are calling this code from the Designer (Button or Script Console) and that means the logs are going to appear in the _Designer Console_, not the Ignition Gateway logs.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 14, 2025, 7:19am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/18 "2025-05-14T07:19:50Z")

</div>

No, I checked but logs not in desinger as well.  
I am editing the py code in VS Code, my changes are saving in VS code but not reflecting in designer and client.  
Earlier when I was saving something in VS code then desinger was blicking and client got restarted automatically.  
But now its not notifying anything in designer and client.  
I think issue is with VS code, any idea how to fix this and get desinger client and VS code in sync?

---

<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:** [May 14, 2025, 11:40am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/19 "2025-05-14T11:40:33Z")

</div>

Please don't use external editors when trying to solve problems with us here on the forum. We can't reproduce your situation and therefore cannot effectively help you. Use just the designer while working through your code problem. You can resolve your external code editing situation after you have no other problems confusing the issue.

---

<div class="post-metadata">

**Author:** ![Anita.Shinde](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Anita.Shinde](https://forum.inductiveautomation.com/u/Anita.Shinde)\
**Post date:** [May 15, 2025, 7:27am UTC](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151/20 "2025-05-15T07:27:12Z")

</div>

okay Thanks!  
The issue got fixed, now I can see my logs.  
The problem was, VS code was not running as administrator , so its not reflecting changes in designer and client.  
I just tried to run it as administrator and it worked.

[Next page](https://forum.inductiveautomation.com/t/unable-to-see-logs-in-gateway/106151.md?page=2)
