Logging

Structured log entries emitted during job and worker lifecycle events.

Queuert emits structured log entries for every lifecycle event — worker start/stop, job creation, attempts, failures, completions, chain lifecycle, blockers, and adapter errors. Logging is part of queuert core and does not require the @queuert/otel package.

Setup

Pass a log function (Log) to createClient to receive log entries. createConsoleLog() is the built-in logger:

src/index.ts

const log = createConsoleLog();

const client = createClient({
  stateAdapter,
  log,
  jobTypes,
});

Log entry structure

Every log entry is a typed object with the following shape:

Entry fields

  • string
    Machine-readable event identifier (e.g. job_created).
  • "info" | "warn" | "error"
    Log level.
  • string
    Human-readable description.
  • object
    Structured data specific to the event.
  • unknown · optional
    Present only on error/warn entries that carry an error.

All entries are strongly typed — the type field determines the exact shape of data, the level, and the message. This means consumers can switch on type for type-safe handling.

Log entries

Each entry shows its message; the chips under it are the keys of data, error is the top-level field, and a trailing ? marks a key that can be absent.

Worker lifecycle

Job lifecycle

  • Job created
    id typeName chainId chainTypeName input blockers scheduledAt
  • Job completed
    id typeName chainId chainTypeName status attempt output? continuedWith?
  • Job blocked by incomplete chains
    id typeName chainId chainTypeName blockedByChains
  • Job rescheduled
    id typeName chainId chainTypeName scheduledAt
  • Job unblocked
    id typeName chainId chainTypeName unblockedByChain

Attempt lifecycle

  • Job attempt started
    id typeName chainId chainTypeName status attempt workerId
  • Job attempt completed
    id typeName chainId chainTypeName status attempt output? continuedWith? workerId
  • Job attempt failed
    id typeName chainId chainTypeName status attempt workerId error
  • Job attempt lost
    id typeName chainId chainTypeName status attempt attemptAt attemptBy workerId
  • Reclaimed job attempt
    id typeName chainId chainTypeName status attempt attemptAt attemptBy workerId reclaimedFrom

Chain lifecycle

Adapter errors

Validation errors

Examples

Loggers

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open