Context
To build a great developer experience and allow for real-time log monitoring (see #53 — TUI Log Tailing), all processes in a vyx project — the Go Core, Node.js workers, and Python workers — must emit logs in a unified, machine-readable format.
This is a foundational piece of the vyx observability stack. Without it, building tools like the TUI, log aggregation, or alerting on top of vyx is impractical.
The Problem
Today, each runtime uses its own logging convention:
| Runtime |
Default output |
Format |
| Go Core |
zap |
JSON (production), text (dev) |
| Node.js workers |
console.log |
Unstructured text |
| Python workers |
logging module |
Unstructured text |
Without a shared schema, it is impossible to:
Proposed Solution
Define a standard JSON log schema for vyx and implement it in every worker SDK. The Go Core will capture worker stdout and can route or re-emit structured log entries.
Standard Log Schema
{
"timestamp": "2026-03-13T21:00:00.000Z",
"level": "INFO",
"service": "node:api",
"req_id": "123e4567-e89b-12d3-a456-426614174000",
"message": "User validation passed",
"data": {}
}
| Field |
Type |
Required |
Description |
timestamp |
ISO 8601 string |
✅ |
UTC timestamp |
level |
DEBUG / INFO / WARN / ERROR |
✅ |
Log severity |
service |
string |
✅ |
Worker ID as defined in vyx.yaml (e.g. node:api) |
req_id |
UUID string |
✔ optional |
Correlation ID from the active request context |
message |
string |
✅ |
Human-readable log message |
data |
object |
✔ optional |
Arbitrary structured metadata |
Implementation Plan
Go Core
Already uses zap with JSON in production mode. Needs verification that service and req_id fields are always present in access logs.
Node.js Worker SDK
Provide a vyx-logger utility that wraps output and automatically injects req_id from AsyncLocalStorage (set by the IPC handler on each request).
// Usage in a worker handler:
import { logger } from '@vyx/worker';
logger.info('User validation passed', { userId: 42 });
// Output: {"timestamp":"...","level":"INFO","service":"node:api","req_id":"...","message":"User validation passed","data":{"userId":42}}
Python Worker SDK
Provide a VyxLogger class that uses logging.Formatter with JSON output and reads req_id from the active contextvars.ContextVar.
# Usage in a worker handler:
from vyx import logger
logger.info("User validation passed", extra={"user_id": 42})
Acceptance Criteria
Dependencies
References
core/infrastructure/logger/ — existing Go logger infrastructure
core/application/gateway/dispatcher.go — access log emission
- Spec §6 – Observability
Context
To build a great developer experience and allow for real-time log monitoring (see #53 — TUI Log Tailing), all processes in a
vyxproject — the Go Core, Node.js workers, and Python workers — must emit logs in a unified, machine-readable format.This is a foundational piece of the
vyxobservability stack. Without it, building tools like the TUI, log aggregation, or alerting on top ofvyxis impractical.The Problem
Today, each runtime uses its own logging convention:
zapconsole.logloggingmoduleWithout a shared schema, it is impossible to:
req_id(see [Feature] End-to-End Request Tracing (Correlation IDs) across Go Core and Workers #52)Proposed Solution
Define a standard JSON log schema for
vyxand implement it in every worker SDK. The Go Core will capture workerstdoutand can route or re-emit structured log entries.Standard Log Schema
{ "timestamp": "2026-03-13T21:00:00.000Z", "level": "INFO", "service": "node:api", "req_id": "123e4567-e89b-12d3-a456-426614174000", "message": "User validation passed", "data": {} }timestamplevelDEBUG/INFO/WARN/ERRORservicevyx.yaml(e.g.node:api)req_idmessagedataImplementation Plan
Go Core
Already uses
zapwith JSON in production mode. Needs verification thatserviceandreq_idfields are always present in access logs.Node.js Worker SDK
Provide a
vyx-loggerutility that wraps output and automatically injectsreq_idfromAsyncLocalStorage(set by the IPC handler on each request).Python Worker SDK
Provide a
VyxLoggerclass that useslogging.Formatterwith JSON output and readsreq_idfrom the activecontextvars.ContextVar.Acceptance Criteria
LOGGING_SPEC.md)serviceandreq_idfields on all access log entriesreq_idfrom contextreq_idfrom contextzaporslogstdoutso the Go Core can capture and route themDependencies
req_idis available in worker contextsReferences
core/infrastructure/logger/— existing Go logger infrastructurecore/application/gateway/dispatcher.go— access log emission