#5527·jupyterhub

Separate logging categories

Author: minrkCreated Sep 21, 2026Updated Sep 24, 2026
Labelsenhancement

Proposed change

I think we should consider splitting our logging such that deployments can have different log levels for different categories of event. The motivating case is debugging a particular behavior (e.g. activity, spawning, authentication) without enabling the incredibly verbose global debug log, which produces a huge amount of noise to sift through.

Alternative options

Don't do this!

Who would use this feature?

Deployments trying to debug a particular behavior enabling a subset of debug logs without flooding the logs with irrelevant noise.

(Optional): Suggest a solution

The simplest and most Pythonic way to do this is to use a collection of Loggers instead of our single global app.log. I'm not 100% sure what the split should be, but probably at least:

  • access (http requests)
  • auth
  • spawner

If nothing else, just being able to debug jupyterhub logs without also including access logs would probably be a big enough benefit, even if we don't split any further.

A slightly more custom approach would be to use a labeling scheme, such that any given log statement might have more than one label, so if the statement is relevant to e.g. spawning and activity could would be added to debug-logging in both. I think we should only consider this if the multi-labelling comes up while trying to.

A simpler but also more custom approach is to put conditionals around debug statements, like if self.debug["category"], so that the log.debug statements never execute if they are not selected. This avoids executing sometimes (rarely) costly debug statements.

This would also potentially enable us to have a deeper, insecure 'not just debug' that logs headers and things that have been useful for debugging in specific circumstances, but should not be logged in general, even at the debug level.