Configurable logging system + exception/content logging fixes - #23
Merged
Merged
Conversation
Centralize logging in app/core/logging_config.py (setup_logging), replacing the scattered basicConfig calls. Driven by env vars (LOG_LEVEL, LOG_FORMAT text|json, LOG_NAME, per-sink levels) or a full dictConfig file (LOGGING_CONFIG_FILE). Sinks: console, rotating file, non-blocking HTTP POST, and Google Cloud Logging (Stackdriver). JSON logs use ISO-8601 timestamps with millisecond precision. Wires the API server, Celery workers and seed scripts. Adds python-json-logger, docs/LOGGING_GUIDE.md and tests.
…ntent In except blocks, convert logger.error to logger.exception and add exc_info=True to logger.warning/critical so stack traces are captured (previously 71 handlers logged only the exception string). Stop dumping LLM responses, extracted document content and prompt bodies in logs; keep lengths, field names and ids instead (notably the JIT extraction INFO log and the metadata-extraction previews).
damienlaine
force-pushed
the
feat/logging
branch
from
June 17, 2026 06:02
c03d976 to
9d0c612
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Logging was 5 scattered
basicConfig()calls, plain text on stdout only, with a singleDEBUGtoggle. No way to ship logs to a centralized system. This makes logging configurable like the LinTO Studio API (Winston): selectable sinks, text or JSON, per-sink levels.Commit 1 — feature: configurable logging
app/core/logging_config.py(setup_logging), called once per process (API, Celery, seeds), replacing the scatteredbasicConfigcalls.LOG_LEVEL,LOG_FORMATtext|json,LOG_NAME, per-sink levels) or a fulldictConfigJSON file viaLOGGING_CONFIG_FILE(WinstonWINSTON_CONFIG_PATHequivalent).servicelabel per process,extra={...}fields preserved.log_config=None),/healthcheckstill filtered.python-json-logger,docs/LOGGING_GUIDE.md, andtests/test_logging_config.py(19 tests).Commit 2 — fix: exception & content logging quality
excepthandlers logged only the exception string. Convertedlogger.error->logger.exceptionand addedexc_info=Truetowarning/criticalinsideexceptblocks.logger.exceptioncount 1 -> 83,exc_info=True0 -> 16.Verification
logger.exception/exc_info=Truesits inside an activeexcept(no "NoneType: None").py_compileOK on all changed files; 775 tests collect with no import errors; 186 passed / 0 failed on the subset touching the changed modules.Notes
google-cloud-loggingis left commented inrequirements.txt(optional, lazy-imported); uncomment to enable the Stackdriver sink.LOG_FORMAT=jsonfor aggregators.