Why Logging Is Not Working On Django Website?
This is what i tried . In my view.py file , import logging logger = logging.getLogger('mylog') logging.basicConfig(format='%(name)s:%(levelname)s:%(message)s',level=logging.INFO,
Solution 1:
Try adding this to handlers:
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
}
and in loggers:
'django': {
'handlers':['console'],
'propagate': True,
'level':'INFO',
},
The log level could be the same or different - In fact the handler defines the minimum level it will log, while the logger defines the minimum level it will send to handler. If one handler is used by two or more loggers - it should ideally has the lowest level from both loggers.
EDIT: Thanks to @jpic for pointing the loggers section.
Post a Comment for "Why Logging Is Not Working On Django Website?"