теперь логируется
All checks were successful
Deploy timelaps / deploy (push) Successful in 5s

This commit is contained in:
ack
2026-04-19 19:49:36 +03:00
parent 4a10958445
commit a8be932210
3 changed files with 57 additions and 4 deletions

View File

@@ -143,3 +143,35 @@ USE_TZ = True
# https://docs.djangoproject.com/en/6.0/howto/static-files/
STATIC_URL = 'static/'
LOG_DIR = BASE_DIR / 'logs'
LOG_DIR.mkdir(parents=True, exist_ok=True)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': '%(asctime)s | %(levelname)s | %(name)s | %(message)s',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'standard',
},
'camlaps_file': {
'class': 'logging.FileHandler',
'filename': str(LOG_DIR / 'camlaps.log'),
'formatter': 'standard',
'encoding': 'utf-8',
},
},
'loggers': {
'camlaps': {
'handlers': ['console', 'camlaps_file'],
'level': 'INFO',
'propagate': False,
},
},
}