Setting the file. One moment.
Troubleshooting · Instrument Logs · PostHog/skills · Skills Docs
ContentsBack to the top of the page 191
Feature Flags Node.js
11
Consuming Endpoints From Client Code
(opens in a new tab)
Problem : Getting 401 Unauthorized errors when sending logs.
Verify you’re using the correct project token from Project Settings (opens in a new tab)
Check the Authorization header format: Bearer <ph_project_token>
If using query parameter, verify the format: ?token=<ph_project_token>
Ensure your project token hasn’t been rotated or revoked
Problem : Cannot connect to the PostHog Logs endpoint.
Verify the endpoint URL: https://us.i.posthog.com/i/v1/logs
Check that your application can make outbound HTTPS requests
Ensure firewall rules allow outbound connections to PostHog
For self-hosted instances, verify the endpoint is correct for your deployment
Problem : Logs are being sent but don’t appear in the PostHog interface.
Verify your project token is correct and associated with the right project
Check that logs are being sent in the correct OTLP format
Ensure your project has access to the Logs feature in PostHog
Check the network tab in your browser/application to verify requests are succeeding (200 status)
Problem : High memory usage or slow log processing.
Adjust the batch size in your OpenTelemetry configuration
Use BatchLogRecordProcessor instead of SimpleLogRecordProcessor for better performance
Consider filtering logs on the client side to reduce volume
Check for network latency between your application and PostHog
Problem : Logs are being received but not parsed correctly.
Ensure you’re using the standard OTLP log format (opens in a new tab)
Verify log levels are set correctly (INFO, WARN, ERROR, etc.)
Check that log attributes are properly structured
Use the OpenTelemetry logging APIs instead of raw log libraries
Problem : Logs are searchable in the Logs view, but the person profile’s Logs tab is empty (or missing logs you expected to see).
Confirm each log record carries the attribute posthogDistinctId (camelCase, lowercase p) — see Link logs to a person (opens in a new tab) . distinct_id, posthog_distinct_id, and user_id are not equivalent unless you’ve explicitly configured one as the custom attribute key (opens in a new tab) .
The value of the attribute must equal one of the person’s distinct_ids exactly — partial or prefixed matches are not picked up.
If your team has customized the attribute key (via the logs_config endpoint), the person profile’s Logs tab shows a hint above the chart indicating which key is being used. Make sure your pipeline emits logs under that exact key.
Date range: the person Logs tab respects the same date range picker as the main Logs view. Expand the range if the logs are older than the default window.
Problem : Confused about which key to use or how to authenticate.
Use your project token (the same one you use for capturing events)
Find it in Project Settings (opens in a new tab)
You can authenticate in two ways:
Header : Authorization: Bearer <ph_project_token>
Query param : ?token=<ph_project_token>
Do not use your personal API key or other authentication methods
Problem : Logs not working with self-hosted PostHog.
Use your self-hosted instance URL instead of https://us.i.posthog.com
Verify the logs endpoint is enabled on your self-hosted instance
Check that the endpoint path is correct: /logs
Ensure your PostHog version supports the logs feature
If you’re still experiencing problems:
Verify your OpenTelemetry client configuration matches the examples in the installation guide (opens in a new tab)
Test with a simple log message first before sending complex logs
Check the network requests to see the actual HTTP status codes and error messages
Contact PostHog support with your specific error messages and configuration details
references/troubleshooting.md