I am trying to get a Logger working for my Django App. I call the logger with:
logger = logging.getLogger(__name__)
logger.info("some stuff")
inside a function in my views.py.
But it doesn't work, the file which is supposed to contain the log is created but nothing is written in it, here are the settings :
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters':{
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
},
'handlers': {
'file_INFO': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(BASE_DIR, 'logs/site.logs'),
'maxBytes': 1024 * 1024 * 15, # 15MB
'backupCount': 10,
'formatter': 'standard',
},
'console_INFO': {
'level': 'INFO',
'class': 'logging.StreamHandler',
}
},
'loggers': {
'INFO': {
'handlers': ['file_INFO', ],
'level': 'INFO',
'propagate': True,
},
},
}
Any idea ?
Thanks !