Getting started with logs
Install and configure logging
PostHog logs is a powerful logging solution that works with the OpenTelemetry Protocol (OTLP). You don't need any vendor specific SDKs – just use standard OpenTelemetry libraries.
Install and configure your logging client to send logs to PostHog:
- Use the HTTP endpoint:
https://us.i.posthog.com/i/v1/logs - Authenticate with your project API key (same API key as events/exceptions)
- Include the API key in the Authorization header or as a
?token=query parameter - Use the standard OTLP log format
Search and analyze your logs
Once your logs are flowing into PostHog, you can:
- Search through logs using multiple search tokens, negative filters, and exact phrase matching
- Filter by time ranges to find specific events
- Correlate logs with events from your PostHog analytics
Navigate to the Logs section in your PostHog dashboard to start exploring your log data.
Query logs with SQL
For advanced analysis, you can query the logs table directly using SQL/HogQL. This enables:
- Custom aggregations across your log data
- Complex filters using SQL syntax
- Joining log data with other PostHog tables like events and persons
A 50GB query limit per query is applied to prevent expensive full table scans.
Troubleshooting
Common issues you might encounter when setting up logging:
- Authentication errors - Make sure you're using your correct project API key
- Connection issues - Verify the HTTP endpoint is accessible
- Log format problems - Ensure you're using the standard OTLP log format