Identify User in Native App Log

It would be nice to see which users are responsible for logged sessions. It would be especially nice to see which users are responsible for errors.

Good suggestion - added to our issue tracker.

The usual factors apply in what we prioritise:

If people reply to this thread saying they’d like this, it will be more of a priority.

We will make a priority of features that are requested by somebody on a support contract - if anybody wishes to discuss further, contact us on support@anvil.works.

You can also sponsor the implementing of a specific feature - again, contact us on support@anvil.works to discuss further.

Achieving this yourself

The App Logs are grouped into sessions, so if you run print(anvil.users.get_user()) when the user logs in, you’ll get the user name at the top of the session.

Here’s an app that does that:

https://anvil.works/build#clone:E4R3NSHCCVDNAF27=EBGAIP2HJO7V5GEB24KMRADU

And here are the App Logs that result from the two user sessions I ran in that GIF:

First user:

Second user:

(Edited - I had a more fiddly solution then I rememberd that App Logs are grouped into sessions!)

2 Likes

Thanks Shaun. I appreciate your quick response. I suppose more robust error handling on my end is the real answer and I clearly do have the capabilities to employ all of the error handling and resulting actions that I want.

1 Like