feat: durable log4cl-backed logging facility (stdout default, init-file sinks) #78
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority:P1
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/quasar!78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/durable-logging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #77.
What
One coherent logging facility for Quasar, built on log4cl, replacing the mix of
diagnostic-log-to-stderr and scattered rawformatwrites.quasar.logpackage (control-plane/src/logging.lisp): structuredlog-eventAPI — level, subsystem, event, structured fields. Keeps the historicalcontrol-plane command.received/workspace operation.beginvocabulary verbatim, plusapp start/start-failed/stop,websocket server.listening,connection.accepted,handshake.rejected,command.crashed,subscriber.failedand friends.[quasar] ISO8601Z LEVEL subsystem event key=valuetext layout on*standard-output*; no files created unless configured.npm run devkeeps showing server output (dev.mjs pipes child stdout).:fileopens the log append-only (survives restarts), one JSON object per line (timestamp,level,subsystem,event,message,fields, liftedrequest_id/workspace_id), immediate flush per record by default (SIGKILLloses at most the in-flight record), interval flush available for throughput, flush+close on shutdown (SIGINT/SIGTERM path).quasar.configsystem, no parallel mechanism):*log-sink*(:stdout/:stderr/:file/:off),*log-file-path*(nil →$XDG_DATA_HOME/quasar/logs/quasar.log),*log-level*(nil →QUASAR_LOG_LEVEL→ CI→info → debug),*log-file-format*(:json/:text),*log-immediate-flush*. Invalid values abort startup with a clear error before any sink state changes (fail closed, like the rest of the init file).diagnostic-logremains as a compatibility alias;QUASAR_LOG_LEVELsemantics unchanged.npm run bench:logging— per-event µs and bytes for stdout text, durable JSON (immediate + interval flush), and the filtered path (reference numbers in the issue comment; e.g. stdout 4.4 µs/event, filtered 0.07 µs/event).docs/CONFIGURATION.mdgains a Logging section (defaults, init-file examples, durability guarantees, file locations, systemd/container recommendations);example_configs/init.lispgains commented examples.Testing
control-plane/tests/logging-tests.lisp: 14 focused tests — stdout default, init override to file, level filtering, structured fields (text+JSON), concurrency line-completeness, restart persistence, flush/shutdown, sink failure, invalid config fail-closed, dispatch/workspace event vocabulary compatibility, level precedence.quasar-testsincl. all subsystem runners) verified against this branch's sources: pass (0 failures on a clean run; one intermittent pre-existingmelissa-testspending-stop timing race reproduces onmain).node scripts/check-control-plane-deps.mjs: pass.npm run smoke: pass.Notes / limitations
~/quicklisp/local-projects/holds symlinks to another quasar checkout, quicklisp's scan can shadow the repo's ownsystems/resolution (pre-existing, reproduces onmain); noted in the issue for a future hardening pass.