@open-infra/telemetry-evlog
v0.2.0
Published
Evlog application logging bridge for OpenInfra OpenTelemetry runtimes.
Maintainers
Readme
@open-infra/telemetry-evlog
Evlog application logging bridge for OpenInfra OpenTelemetry runtimes.
It uses the existing runtime log pipeline, without another provider or batch queue.
npm install @open-infra/telemetry-server @open-infra/telemetry-evlog evlogimport { createServerTelemetry } from '@open-infra/telemetry-server';
import { initTelemetryEvlog } from '@open-infra/telemetry-evlog';
const telemetry = createServerTelemetry({ serviceName: 'orders-api' });
await telemetry.start();
const appLog = initTelemetryEvlog(telemetry, { pretty: false });
appLog.log.info({ action: 'order.accepted', channel: 'web' });
// After application requests have drained:
await appLog.flush();
await telemetry.shutdown();For an existing Evlog setup, use createTelemetryEvlogDrain(telemetry) as its drain. It maps levels, timestamps, bounded structured attributes, and trace context to the runtime logger. Active OpenTelemetry context takes precedence over explicit event trace IDs. Evlog redaction remains enabled by default; final runtime sanitization also applies.
initTelemetryEvlog requires a running runtime. Its flush() flushes the runtime; the raw drain has no separate buffer. onError may report normalization failures through an independent diagnostic channel.
ESM with TypeScript declarations, Node.js 20.11 or newer. See logging. Apache-2.0.
