fix(logging): T-5 — production logs INFO to stdout

docker logs tatlock has been empty for months and the /app/logs
mount untouched since 2025-12. Not a broken handler: the stdout
StreamHandler was correct all along, but the production default
level was WARNING ("minimal noise") and a healthy service warns
roughly never — startup, backend flavor detection and the wrapper's
balancing/compaction signals were all suppressed, which is exactly
what made the serving cutover unverifiable from logs on 2026-09-12.

Production now defaults to INFO; LOG_LEVEL stays the override for
when noise is ever the real problem; development keeps DEBUG. The
mount was always decorative — no file handler exists, docker logs is
the log. Three tests pin the level table, the WARNING-revert
mutation shown to fail its test.

Also filed T-7: the full suite flaked once and passed on rerun for
the second time — next occurrence keeps the failing run's output.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-13 11:00:50 +02:00
co-authored by Claude Fable 5
parent cbec26835d
commit aace128ef9
6 changed files with 62 additions and 3 deletions
+35
View File
@@ -241,6 +241,41 @@ class TestLoggingConfiguration:
with patch.object(config, "ENVIRONMENT", Environment.PRODUCTION):
assert config.log_format == "json"
def test_production_default_level_is_info(self):
"""Production logs INFO to stdout (T-5).
The old WARNING default made `docker logs` empty for months — a
healthy service warns roughly never, so startup, flavor
detection and the wrapper signals were all suppressed and the
serving cutover could not be verified from logs.
"""
from src.core.config import Environment, config
with (
patch.object(config, "ENVIRONMENT", Environment.PRODUCTION),
patch.object(config, "LOG_LEVEL", None),
):
assert config.effective_log_level == "INFO"
def test_log_level_env_still_quiets_production(self):
"""LOG_LEVEL stays the override for when noise is the problem."""
from src.core.config import Environment, config
with (
patch.object(config, "ENVIRONMENT", Environment.PRODUCTION),
patch.object(config, "LOG_LEVEL", "WARNING"),
):
assert config.effective_log_level == "WARNING"
def test_development_default_stays_debug(self):
from src.core.config import Environment, config
with (
patch.object(config, "ENVIRONMENT", Environment.DEVELOPMENT),
patch.object(config, "LOG_LEVEL", None),
):
assert config.effective_log_level == "DEBUG"
def test_multiple_loggers_independent(self):
"""Test multiple loggers are independent."""
logger1 = get_logger("test.logger1")