Skip to main content
Send logs to Sentry’s structured logs (Explore → Logs). Every meta field becomes a typed, searchable attribute, and logs link to traces through trace_id — no Sentry SDK required.

Setup

  1. Create (or open) a project in Sentry and copy its DSN from Settings → Projects → Client Keys (DSN).
  2. Set the environment variable:
  1. Wire the transport:
  1. Trigger a request and open Explore → Logs in Sentry.

Environment Variables

Options

Plus the shared batching options: maxBatchSize, flushIntervalMs, timeout, retries — see the overview.

Payload

Logs post to the project’s envelope endpoint as Sentry log items:
  • Body — the log message, or GET /path for access logs.
  • LevelDEBUGdebug, INFOinfo, WARNINGwarn, ERRORerror.
  • Attributes — meta fields flattened to typed attributes (string, integer, double, boolean): request.method, status, durationMs, context.requestId, and anything you merge into the request context.
  • Trace ID — reused from context.trace_id when logixlysia/otel injected one (linking logs to the trace), otherwise generated.
Filter in Sentry by any attribute, e.g. status:500 or context.requestId:0d5e….

Troubleshooting

  • 401 / 403 — the DSN was revoked or belongs to another project; copy a fresh one from Client Keys.
  • invalid DSN at startup — the expected shape is https://<public-key>@<host>/<project-id>.
  • Logs don’t link to traces — make sure trace_id reaches the request context via logixlysia/otel.