Install OpenTelemetry logging
Logs is currently in beta. To gain access, opt-in to the beta from your feature previews menu. Logs is free to use during beta, though we'd love to hear your feedback in app.
- 1
Install OpenTelemetry packages
RequiredPostHog logs works with any OpenTelemetry-compatible client. You don't need any PostHog-specific packages - just use standard OpenTelemetry libraries.
Terminal - 2
Get your project token
RequiredYou'll need your PostHog project token to authenticate log requests. This is the same token you use for capturing events and exceptions.
You can find your project token in Project Settings.
- 3
Configure the SDK
RequiredSet up the OpenTelemetry SDK to send logs to PostHog.
JavaScriptAlternatively, you can pass the token as a query parameter:
JavaScript - 4
Use OpenTelemetry logging
RequiredNow you can start logging with OpenTelemetry. Here are examples for each language:
JavaScript - 5
Next steps
CheckpointWhat you can do with your logs