config/conf/logs.py: logs file qo'shildi, muntazam ravishda loglarni yozib borish uchun

This commit is contained in:
behruz-dev
2025-12-05 16:26:44 +05:00
parent f8af606ca9
commit d8f4e44102
5 changed files with 33 additions and 0 deletions

27
config/conf/logs.py Normal file
View File

@@ -0,0 +1,27 @@
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"verbose": {
"format": "{levelname} {asctime} {module} {message}",
"style": "{",
},
},
"handlers": {
"daily_rotating_file": {
"level": "INFO",
"class": "logging.handlers.TimedRotatingFileHandler",
"filename": "resources/logs/django.log",
"when": "midnight",
"backupCount": 30,
"formatter": "verbose",
},
},
"loggers": {
"django": {
"handlers": ["daily_rotating_file"],
"level": "INFO",
"propagate": True,
},
},
}