Skip to content

Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.

TypeScript

fix(logging): also write production logs to stdout for docker visibility (#870)

chriscrosstalk737e6784f08d
diff --git a/admin/config/logger.ts b/admin/config/logger.ts
index 981e1675..3ce310e0 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(),
},
},