Skip to content

LogOptions

Defined in: bindings/node/dist/index.d.ts:1030

Specify options for the logger

optional level?: LogLevel

Defined in: bindings/node/dist/index.d.ts:1040

Filter logs by level. Also the level exported to OTLP when otelEndpoint is set (the appender ships events at this level).


optional otelEndpoint?: string

Defined in: bindings/node/dist/index.d.ts:1052

OTLP endpoint (e.g. “http://collector:4317”). When set, spans AND logs are exported via OTLP to this endpoint. A downstream OpenTelemetry Collector derives metrics from the spans and forwards the correlated logs.


optional otelSampleRatio?: number

Defined in: bindings/node/dist/index.d.ts:1056

Fraction of root spans sampled, from 0 to 1.


optional otelServiceName?: string

Defined in: bindings/node/dist/index.d.ts:1054

Service name attached to exported telemetry.


optional resourceAttributes?: Record<string, string>

Defined in: bindings/node/dist/index.d.ts:1062

Resource attributes attached to all exported spans (e.g. { “service.instance.id”: “herald-7”, “deployment.environment”: “prod” }). Use these to attribute telemetry to its source.


optional stdoutLevel?: LogLevel

Defined in: bindings/node/dist/index.d.ts:1046

Level for the stdout console layer only. Defaults to level. Set to warn to quiet stdout below the OTLP export level — e.g. so a log shipper does not duplicate logs already exported via OTLP, while OTLP still receives level.


optional structured?: boolean

Defined in: bindings/node/dist/index.d.ts:1035

enable structured JSON logging to stdout.Useful for third-party log viewers an option so that it does not require being specified in js object.