There is a tricky "feature" in python's logging module. Let's explore it.
Considering the code below
import logging main_logger = logging.getLogger("mywebapp") controllers_logger = logging.getLogger("mywebapp.controllers") models_logger = logging.getLogger("mywebapp.models")
That is really cool for having separate loggers under the same
mywebapp namespace, the trick is that when setting up logging, you must set up only the topmost item in the hierarchy:
make sure to not add handlers to the
controllers_logger or to the