Setup
- Copy your project API key (
phc_…) from Settings → Project → Project API Key. - Set the environment variables:
- Wire the transport:
- Trigger a request and find
logixlysia_logevents 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’sdistinct_id resolves to it:
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 withphc_.- 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
logFilterbefore they reach the transport.