From f08928d40d1798976a37d96226d936d450faebf3 Mon Sep 17 00:00:00 2001 From: chriscrosstalk <49691103+chriscrosstalk@users.noreply.github.com> Date: Wed, 27 May 2026 14:19:15 -0700 Subject: [PATCH] fix(logging): also write production logs to stdout for docker visibility (#870) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In production, the logger was configured with a single file target writing to `/app/storage/logs/admin.log`. Because the production pino transport had no stdout target, `docker logs nomad_admin` only saw startup banner lines from non-pino sources — every `logger.info`/`logger.debug` call from controllers, services, and providers was effectively invisible from outside the container. That's been silently masking diagnostics for anyone trying to debug a running NOMAD without exec-ing into the admin container and tailing the log file. RAG retrieval scores, query rewrites, container preflight decisions, version check results — all of it was there in `admin.log` but absent from any external observation point (docker logs, container log aggregators, etc.). This adds a second production target writing JSON to stdout (fd 1) via the same pino/file transport. Effect: `docker logs nomad_admin` now shows the full runtime telemetry, the persisted log file is unchanged (so Debug Info bundle export keeps working), and external log aggregators that scrape container stdout now have something to scrape. Verified on NOMAD8 (v1.32.0-rc.3): post-patch `docker logs --tail 15 nomad_admin` shows the structured `{"level":30,...,"msg":"[VersionCheckProvider] Checking for stale updateAvailable..."}` lines that previously only existed in admin.log. File destination still receives writes (size delta confirmed after an `/api/system/info` hit). This is the unblock for the AI Quality eval work — without log visibility, every diagnostic conversation about RAG retrieval and query rewriting is guesswork. Co-authored-by: Claude Opus 4.7 (1M context) --- admin/config/logger.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/admin/config/logger.ts b/admin/config/logger.ts index 981e167..3ce310e 100644 --- a/admin/config/logger.ts +++ b/admin/config/logger.ts @@ -18,7 +18,14 @@ const loggerConfig = defineConfig({ targets: targets() .pushIf(!app.inProduction, targets.pretty()) + // Production: write JSON to both the persisted log file (for Debug + // Info bundle export) AND stdout (so `docker logs nomad_admin` and + // any external log aggregator can see runtime telemetry — RAG + // retrieval scores, query rewrites, etc.). Writing to fd 1 via + // pino/file is the standard way to do this; without it, prod + // installs are effectively running blind from a debugger's POV. .pushIf(app.inProduction, targets.file({ destination: "/app/storage/logs/admin.log", mkdir: true })) + .pushIf(app.inProduction, targets.file({ destination: 1 })) .toArray(), }, },