Skip to main content
Send logs to PostHog as captured events. Each log becomes an event with dot-notation properties you can use in filters, insights, and cohorts — and logs carrying a user ID link to PostHog persons automatically.

Setup

  1. Copy your project API key (phc_…) from Settings → Project → Project API Key.
  2. Set the environment variables:
  1. Wire the transport:
  1. Trigger a request and find logixlysia_log events in the activity explorer.

Environment Variables

Options

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

Payload

Logs post to {host}/batch/. Each event carries flat, chart-friendly properties: PostHog processes events asynchronously — expect them to appear within about a minute.

Linking Logs to Persons

Merge a user ID into the request context and the log’s distinct_id resolves to it:
Point distinctIdField at any other meta path (dot notation) if your identifier lives elsewhere. Without an identifier, events fall back to the static distinctId — handy for a backend acting as a single identity.

Troubleshooting

  • 401 — the key is not a project API key; it must start with phc_.
  • Events missing — check the region: EU projects must use https://eu.i.posthog.com.
  • High event volume — log levels you don’t need can be excluded with logFilter before they reach the transport.