Skip to content

obs: Use structured logger consistently across processing worker #228

@Xhristin3

Description

@Xhristin3

Problem Statement

The processing worker has a structured Logger class (xstreamroll-processing/src/logger.ts) with correlation IDs, log levels, and JSON output. However, worker.ts uses console.error, console.warn, and console.log directly instead of the structured Logger.

Evidence

// worker.ts — uses console.* directly
console.error(`[${WORKER_ID}] polling failed: ${message}`)
console.warn(`[${WORKER_ID}] dropping malformed event`, event)
console.log(`[${WORKER_ID}] stream processor started...`)

Impact

Worker logs are split between structured JSON (Logger) and unstructured console output. Correlation IDs not applied to worker lifecycle events. Log ingestion tools can't parse console.* lines consistently.

Proposed Solution

Replace all console.* calls in worker.ts with structured Logger calls. Pass the logger to SessionRegistry and EventFilter. Use logger.child() for per-stream context.

Acceptance Criteria

  • Worker uses structured Logger for all log output
  • Correlation IDs applied to poll loop and session events
  • No bare console.* in worker.ts
  • Existing Logger tests pass

File Map

  • xstreamroll-processing/src/worker.ts — use Logger
  • xstreamroll-processing/src/session-registry.ts — accept logger parameter

Labels: observability
Priority: Low | Difficulty: Intermediate | Estimated Effort: 1d


Labels: observability
Priority: Low | Difficulty: Intermediate | Estimated Effort: 1d
Backlog ID: REPO-045

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions