- Logging is configured as part of the general Django setup() function.
- There are mainly 4 components
- Handles only messages that are greater than equal to it’s log level
- There are 5 log levels in Python
- Can have multiple handlers for one logger
- The name is usually
logger = logging.getLogger('project.interesting.stuff')
project.interesting is a parent of
project is a parent of `project.interesting
- So you can define handlers for child loggers in parent level.
- Defining a logger on
project will capture the logging calls in
- There is option to turn this off as well.
- Handlers decide what to do with the mesage
- eg ; write message to screen, file, socket etc
- Handlers also have log levels. So the message should atleast have the log level of the handler.
- Provides additional control on what messages are passed from logger to handlers.
- Can update the log level of the message if necessary/
- Can be installed on loggers or handlers
- Every record is rendered at text at the end.
- Formatter describes the exact format of the text.