# Audit Events not logging when using system.tag.write?

**URL:** <https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 24, 2024, 1:46am UTC](https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845 "2024-05-24T01:46:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [May 24, 2024, 1:46am UTC](https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845/1 "2024-05-24T01:46:26Z")

</div>

I have two types of binding and control a valve.  
One : Direct bind Tag

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

Audit Events can log the tag write .

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

Two: Click Script write Tag

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

Audit Events can't log the tag write .

How to resolve the Two question?

---

<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 24, 2024, 3:07am UTC](https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845/2 "2024-05-24T03:07:46Z")

</div>

Maybe use [system.util.audit](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-audit) to manually log the write to the audit db.

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [May 24, 2024, 3:11am UTC](https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845/3 "2024-05-24T03:11:34Z")

</div>

> [@ryan.white](#):
>
> [system.util.audit](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-audit)

Is there anything I need to set up in Audit?

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

In Vision I see:  
Script in Button - actionPerformed.

 ![8f2c68f487c93b48ab48955fcb56fee](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/228d9c7c5b9805574f60b1350ab8a8105ee8b231.png)

It can log it in Audit.

 ![f4db528e89a7f422ea4be66672f95d9](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec150b840c63de384cae92432bdf558dd6df0fda.png)

In Perspective Script why not?

---

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [May 24, 2024, 6:12am UTC](https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845/4 "2024-05-24T06:12:54Z")

</div>

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

system.tag.writeBlocking([tagpath], [value]) ---Can log it in Audit.

system.tag.write(tagpath,value)------Can't log it in Audit.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/f/4fbf4e99737b594edb339635ffad884ef50c4aee.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 24, 2024, 6:12pm UTC](https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845/5 "2024-05-24T18:12:18Z")

</div>

> [@taohongyu88](#):
>
> Is there anything I need to set up in Audit?

Looks like everything is set up normally, should be able to just use the function.

`system.tag.write` is deprecated and kept around for backwards compatibility. (For updating from V7.x to 8.x) You should only use `system.tag.writeBlocking`, even with single tag writes. I bet the older function is missing something that ties it into the audit system but IA would have to confirm.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 24, 2024, 6:29pm UTC](https://forum.inductiveautomation.com/t/audit-events-not-logging-when-using-system-tag-write/90845/6 "2024-05-24T18:29:29Z")

</div>

Perspective scripts run on the gateway. Did you set the Audit profile there?

Security -\> General -\> Gateway Audit Profile

EDIT: nvm, I don't think that captures it.
