I have yet to find a way of setting up Python logging with Django that I\'m happy with. My requirements are fairly simple:
We initialize logging in the top-level urls.py
by using a logging.ini
file.
The location of the logging.ini
is provided in settings.py
, but that's all.
Each module then does
logger = logging.getLogger(__name__)
To distinguish testing, development and production instances, we have different logging.ini files. For the most part, we have a "console log" that goes to stderr with Errors only. We have an "application log" that uses a regular rolling log file that goes to a logs directory.