# Auth0 login and logout activty measure

**URL:** <https://community.auth0.com/t/auth0-login-and-logout-activty-measure/187609>\
**Category:** Get Help\
**Tags:** insights-monitoring, tenant-logs-search\
**Created:** [June 4, 2025, 4:20pm UTC](https://community.auth0.com/t/auth0-login-and-logout-activty-measure/187609 "2025-06-04T16:20:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rshah](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rshah/32/59998_2.png) [@rshah](https://community.auth0.com/u/rshah)\
**Post date:** [June 4, 2025, 4:20pm UTC](https://community.auth0.com/t/auth0-login-and-logout-activty-measure/187609/1 "2025-06-04T16:20:30Z")

</div>

I want to capture how many hours in a day user spends time , one of the way is to capture through Auth0 login and logout events , how to capture that for a user ?

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [June 4, 2025, 9:04pm UTC](https://community.auth0.com/t/auth0-login-and-logout-activty-measure/187609/3 "2025-06-04T21:04:12Z")

</div>

Hello @rshah

Thank you for reaching out to us!

You should indeed be able to base the time a user spends by considering the login and logout events. It is possible to retrieve the logs via the [Auth0 Management API](https://auth0.com/docs/api/management/v2), using the `GET /api/v2/logs` endpoint, which can then be filtered by user\_id. Within these logs, you would want to consider the success login event ( s ) and the success logout event ( slo ), please see the following documentation for the full list of [Log Type Codes](https://auth0.com/docs/deploy-monitor/logs/log-event-type-codes#:~:text=a%20leaked%20password.-,slo,-Success%20Logout). A user’s spent time should potentially be calculated as Session Duration = Logout Timestamp - Login Timestamp.

Please do take into consideration that a user could stay inactive on the tenant, which might not create a Success Logout event within the logs and the user would essentially ’ logout ’ once their session expires. If the logout event in the logs is missing, it should be an indication of this.

Hope that helped!  
Gerald

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 18, 2025, 9:05pm UTC](https://community.auth0.com/t/auth0-login-and-logout-activty-measure/187609/4 "2025-06-18T21:05:07Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
