How to collect a user login history log

  1. My Goal

I want to collect the following logs. (Like last command in a Linux )
(1) a user login (ex. user alice login at 2024-03-22 17:00:00)
(2) a user logout (Or image expire removed time)

  1. Questions

(1) Logging feature
Do you have any features like that?
Is The best way to execute kubectl logs hub-XXXXX-XXXXX -n z2jh ?

  1. Environment

(1) K8s: v1.29.2
(2) z2jh: jupyterhub-3.1.0 (app 4.0.2 )

Best regards.

Yes, everything should be in the hub logs, including logins, and start/stop of the singleuser server.

If you wanted something more structured, e.g. to send specific events to a remote auditing server for real-time alerting, you can either use a log management system to parse the logs, or you could configure some authenticator and spawner hooks, or override some of the methods, e.g. Spawners — JupyterHub documentation

Hello, @manics Thank you for your reply!