I have this configuration in my project:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'WARNING',
'class': 'logging.FileHandler',
'filename': os.path.join(BASE_DIR, 'debug.log'),
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'WARNING',
'propagate': True,
},
},
}
Now its size grows uncontrollably. Is there a way to control a size of debug.log
file? What is the best way to operate with log files in Django projects?
I have found similar question but I am not calling python logger directly.