Oleqlog

Usage

Send events, levels, optional fields, and client options with @oleq-ai/logs

Send events

await log.info({ message: "server started" });
await log.warn({ message: "slow query", body: { ms: 420 } });
await log.error({
  message: "payment failed",
  kind: "res",
  body: { status: 402 },
});

await log.flush();

Call flush() before process exit or in serverless handlers so batched events are sent.

Levels

Pass as type on the event, or call the matching method (log.info(…), log.error(…), …).

tracedebuginfosuccesswarnerrorfatalauditmetric

Legacy clients may send warning — ingest normalizes it to warn.

Optional fields

FieldNotes
kindreq or res — separate events; dashboard shows REQ / RES badges
bodyAny JSON-serializable attachment
track / security / metricsStructured blobs on the event

Options

OptionRequiredDefault
appNameyes
apiKeyno*OLEQLOG_API_KEY
baseUrlnoproduction API
environmentnoNODE_ENV or development
flushIntervalMsno2000
maxBatchSizeno50
ingestUrlno— (browser proxy mode; no API key on client)

*Required unless OLEQLOG_API_KEY is set (or ingestUrl is used for proxy mode).

Adapters

Official subpath exports for Express, NestJS, Next.js, and React — middleware, modules, server helpers, and a client hook.

See Adapters for setup and code samples.

Pino

Already using Pino? See Pino transport — same package, worker thread, level mapping built in.

More recipes: Examples

On this page