Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions app/settings.py

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

пересмотреть disable_existing_loggers=True, чтобы не потерять системные логи Django/библиотек.

Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,26 @@
TINKOFF_ID_USERINFO_URL = "https://id.tinkoff.ru/userinfo/userinfo"
TINKOFF_ID_INTROSPECT_URL = "https://id.tinkoff.ru/auth/introspect"
TINKOFF_ID_SCOPE = ["profile", "email"]

# Logging
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"default": {
"format": "[{asctime}] #{levelname:8} {name}:{lineno}:{funcName} - {message}",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

форматтер сейчас очень “шумный” ({lineno}:{funcName}) и при DEBUG=True будет много логов. Это ок для дев-режима, но в проде обычно выбирают уровень INFO (а не WARNING), плюс отдельные правила для django.request (например, 4xx/5xx). Можно подумать над более “продуктовым” дефолтом уровня/логгеров.

"style": "{",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

handler logging.StreamHandler по умолчанию пишет в stderr. В контейнерах обычно ожидают stdout. Можно явно задать stream: "ext://sys.stdout" (или оставить как есть, если в проекте принято stderr).

'stream': 'ext://sys.stdout',
"formatter": "default",
},
},
"root": {
"handlers": ["console"],
"level": "WARNING" if not DEBUG else "DEBUG",
},
}