how to configure JupyterHub to logging code execution for each user
JupyterHub starts a singleuser server (e.g. JupyterLab/jupyter-server), but otherwise has limited interaction with that server. Code execution is handled by kernels, so that’s one place logging could be added, there’s a category for discussing kernels on this forum:
However since jupyter-server is usually running as the user they could ultimately override what it’s doing. If that’s an issue you’ll have to look at something outside Jupyter, at the operating system level.