# How can I track who pushes every button in my HMI?

**URL:** <https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 10, 2025, 10:55pm UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085 "2025-11-10T22:55:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![noel.gomez](https://avatars.discourse-cdn.com/v4/letter/n/d07c76/32.png) [@noel.gomez](https://forum.inductiveautomation.com/u/noel.gomez)\
**Post date:** [November 10, 2025, 10:55pm UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085/1 "2025-11-10T22:55:30Z")

</div>

I need to track every single toggle that happens in my HMI individually. Each person has a individual log in.

---

<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:** [November 10, 2025, 11:10pm UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085/2 "2025-11-10T23:10:39Z")

</div>

Every single **button push** , no such mechanism exists.

Every button push that **writes to a tag** , enable project auditing:

> **[Audit Log and Profiles | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/platform/audit-log-and-profiles#enabling-auditing-in-a-project)**
>
> Ignition's built-in auditing system automatically records certain actions that occur in the system, such as a Tag writes or User Source authentication, into a SQL database table. Utilizing the system involves creating an Audit Profile, followed by...

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [November 10, 2025, 11:26pm UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085/3 "2025-11-10T23:26:33Z")

</div>

well, you could have every button action inherit from a global script that got current user and wrote to a DB?

---

<div class="post-metadata">

**Author:** ![noel.gomez](https://avatars.discourse-cdn.com/v4/letter/n/d07c76/32.png) [@noel.gomez](https://forum.inductiveautomation.com/u/noel.gomez)\
**Post date:** [November 10, 2025, 11:32pm UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085/4 "2025-11-10T23:32:00Z")

</div>

Darn I was hoping I could have all my buttons tracked. I cannot do one by one my HMI is to extense

---

<div class="post-metadata">

**Author:** ![Chris\_Murphy](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Chris\_Murphy](https://forum.inductiveautomation.com/u/Chris_Murphy)\
**Post date:** [November 11, 2025, 12:47am UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085/5 "2025-11-11T00:47:31Z")

</div>

You can also add entries into the audit log yourself with system.util.audit(), all of that methods parameters are optional and will auto populate for you, like the current session user, timestamp etc.

[system.util.audit | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-util/system-util-audit)

If you have an extensive interface and this is a major rework, perhaps consider using custom views for things like this next time. you can have a view that is nothing but a button that will log the action, send a message, manage permissions etc. Then adding functionality is only done in one place. We have three or four different buttons like this for different purposes like page navigation and equipment control. Page nav has alarm aggregation built in, device control has logging and permissions built in etc etc.

---

<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:** [November 11, 2025, 8:06am UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085/6 "2025-11-11T08:06:31Z")

</div>

Are the buttons writing to tags? Or a mixture of that and other things?

This might be a dumb question… but I wonder if there's any way to decorate event handler functions?

You could potentially use vs code with find and replace for event handler code to add an audit log function call, searching all views

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [November 11, 2025, 1:06pm UTC](https://forum.inductiveautomation.com/t/how-can-i-track-who-pushes-every-button-in-my-hmi/112085/7 "2025-11-11T13:06:23Z")

</div>

How is the logic of your push buttons? Is all your business logic on the extension function or do you call a function immediately? This is one of the main organizational reasons to make all events a one liner to a function. If your button calls a function immediately, then you can use something like this

```python
from functools import wraps

def getFullFunctionName(fn):
    try:
        fnPath = "{}.{}".format(fn.func_code.co_filename.split(':')[1].replace('>',''), fn. __name__ )
    except:
        fnPath = fn. __name__
    return fnPath

def audit(fn):
    """
    Logs the params. Always logs
    More suitable for button presses.
    """
    @wraps(fn)
    def wrap(*args, **kwargs):
        funcName = getFullFunctionName(fn)
        system.util.audit("Function:{} args:{} kwargs: {}".format(funcName, str(args), str(kwargs)))
        result = fn(*args, **kwargs)
        # Or wait until here and you can audit args, kwargs and result
        return result            
    return wrap

```

Then your business logic can be

```python
@audit
def doSomething():
    pass

```

and your button would call the `doSomething()` function, and this would audit the args and kwargs of the function (good to know) and your system.util.audit would take care of the rest ie what user at what timestamp. So all you would have to do is bolt on a `@audit` onto all the business functions you care to audit.

This would not tell you what particular button (not sure the use of that anyways) but assuming that only 1 or a handful of buttons can trigger the same business logic (and if there are more than 1 button trying to do the same business logic you really should be doing a function call anyways to avoid having differing versions of the logic) it should be easy to trace out.
