I want to setup a Sentry logger for a Django project. I will define a sentry
handler and will put that handler in the root logger with error
level.
According to the documentation of logging
module, there a special root
key:
root
- this will be the configuration for the root logger. Processing of the configuration will be as for any logger, except that thepropagate
setting will not be applicable.
At the same time in other places a logger with name ''
is used to contain configuration for the root logger.
Does this have the same effect? What is preferable?
>>> import logging
>>> logging.getLogger('') is logging.root
True
>>>