fix(logging): tracebacks show locals only with LOG__SHOW_LOCALS, prod logs stop dumping tokens and request bodies

This commit is contained in:
hh committed 2026-10-08 05:13:17 +02:00
1 parent 92716b79b6
commit 4cb3b85321
3 files changed
+4 -3

No files matched your search

@@ -22,6 +22,7 @@ class LogSettings(Section):
level: str = "INFO"
level_external: str = "WARNING"
show_time: bool = False
show_locals: bool = False
console_width: int = 150
{% if database == 'mongo' %}
@@ -28,7 +28,7 @@ def setup_logging() -> None:
markup=True,
rich_tracebacks=True,
enable_link_path=False,
tracebacks_show_locals=True,
tracebacks_show_locals=env.log.show_locals,
omit_repeated_times=False,
show_time=env.log.show_time,
{%- if 'aiogram_bot' in backend_services %}
@@ -37,7 +37,7 @@ def setup_logging() -> None:
)
],
)
install(console=console, show_locals=True)
install(console=console, show_locals=env.log.show_locals)
logger = logging.getLogger("{{ project_slug }}")