# Insert into Audit Log

**URL:** <https://forum.inductiveautomation.com/t/insert-into-audit-log/12419>\
**Category:** Ignition\
**Created:** [November 30, 2016, 8:59pm UTC](https://forum.inductiveautomation.com/t/insert-into-audit-log/12419 "2016-11-30T20:59:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David.Reed.Schmidt](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@David.Reed.Schmidt](https://forum.inductiveautomation.com/u/David.Reed.Schmidt)\
**Post date:** [November 30, 2016, 8:59pm UTC](https://forum.inductiveautomation.com/t/insert-into-audit-log/12419/1 "2016-11-30T20:59:26Z")

</div>

Is there a script function that will insert into an existing audit log.

This would be the opposite of the system.util.queryAuditLog.

Something like ‘system.util.updateAuditLog’

This is what I’m looking to accomplish. When a user closes a window I want the action and actor to be recorded into the audit log.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [December 1, 2016, 12:05am UTC](https://forum.inductiveautomation.com/t/insert-into-audit-log/12419/2 "2016-12-01T00:05:04Z")

</div>

Hi David,

Audit logs are stored in a database table. Audit logs are associated with a database connection and database table that is configured with the audit log in the Gateway configuration.

So you can find out what database and database table the audit log information is going to. Then you can insert your own data using system.db.runPrepUpdate.

Best,

---

<div class="post-metadata">

**Author:** ![Trent.Boudreaux](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/trent.boudreaux/32/4138_2.png) [@Trent.Boudreaux](https://forum.inductiveautomation.com/u/Trent.Boudreaux)\
**Post date:** [July 30, 2018, 9:36pm UTC](https://forum.inductiveautomation.com/t/insert-into-audit-log/12419/3 "2018-07-30T21:36:25Z")

</div>

Are there any known issues or best practices with inserting records manually into the AUDIT\_EVENTS table?
