Add change Script to the session.props.id

Hi

I try to catch the event when someone opens the designer and saves the user info in the database. I try to put my code in the change script event of session.props.id but it seems Ignition can't detect the changes of this property.

Also, Perspective > Session Events > Startup doesn't trigger when the designer is opened.

So, I am looking for a location to give me an event when the designer opens.

Calling system.perspective.getSessionInfo() periodically gives this information but the problem is not efficient and I need to poll the function.

Isn't this logged already on the Audit log, could you query that and pull the information across to your new table?

No the logout info in audit has no information about who logout

What's going wrong exactly, what is the designer saving in user info you are trying to catch? Are you trying to prevent the designer from overwriting something for user info, or just log when the designer makes changes to it for record keeping?

I just want to track user activities on the designer. So I want when someone open the designer and close it I get event and save his/her info into my database.
info:
username
project
sessionId
usersource/idp
loginTime
logoutTime

This is almost trivial in an SDK module. Time to learn a little java, I think. :grinning:

4 Likes

This is where I get confused because that should be in the audit log, shouldn't it?

A quick sample of me doing a few things in the designer:

The problem is each project may use a different audit database and it is hard to track developer work in different databases.

I need something centralized in one database. Also in the audit, there is no record of idp and sessionId( I need sessionId to match the pair of login/logout)
Maybe there is two user name in different idp(usersource)

an expression binding(with just a string in it or whatever) on a session.custom prop with a script transform attached to it seems to trigger once on launch. Might trigger extra on edits though

1 Like

The designer itself does not use the project's authentication settings.

For clarity, these events would be in the gateway auditing-- just one log regardless of project.

1 Like

If the designer authentication uses an idp instead of 'Classic', would there still be a session id of sorts? Just not something that get's used in the log?

EDIT: I realize that's starting to go off into the weeds, but maybe something to look into for 8.3

1 Like

The project accepts one audit profile and this profile is different for each project.
If you miss this setting nothing will log for user activities in desinger.

No, actually we use idp now for designers.

We want to create some sort of admin tool to visualize users' activities including both clients (operators) and developers. The problem is the user runtime activities log as Unauthenticated in the audit for both login/out.

At the same time if I use Perspective session startup and shutdown it doesn't catch designer.

wasnt that fixed after you did this?

Yes and no, as you mentioned the session startup and shutdown don't trigger the event change script. So even if I use binding in the custom part, I definitely lose the shutdown events in the designer.