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)
Questions
(1) Logging feature
Do you have any features like that?
Is The best way to execute kubectl logs hub-XXXXX-XXXXX -n z2jh ?
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