Getting started with Logs
Use your logging client
PostHog Logs works with any OpenTelemetry client. No PostHog-specific packages required. Use the OTel SDKs you already have, point them at PostHog's HTTP endpoint, and drop in your project token.
On the frontend, our JavaScript web SDK and React Native SDK include first-class logging support.
Follow the guides below to set up your logging client:
Send context-rich logs
PostHog ingests logs in the same pattern as OTel's structured logging model: resource attributes, log attributes, and trace context.
Enrich your logs with granular detail and business context for INFO, DEBUG, WARN, and ERROR log levels.
Search and analyze your logs
Once your logs are flowing into PostHog, you can:
- Search through logs using full-text searches, multiple search tokens, and negative filters
- Filter by time ranges to find specific events
- Filter on attributes for specific resources or events
- Correlate logs with events from your PostHog analytics


Use MCP and AI to debug
Connect the PostHog MCP server and your AI agent can query logs directly. Use Cursor, Claude Code, or any MCP-compatible tool.
Your coding agent pulls the relevant logs it needs to debug and build faster without switching workflows.
You can also ask PostHog AI to search and analyze your logs.


Try out these prompts:
Show me error logs from the API service in the last hourFind all logs related to authentication failures todayShow logs from the payment service around 2pm yesterday
Integrate your product data
With PostHog, your logs live alongside your Product Analytics, Session Replays, and Error Tracking, so you can go from a log line to a user's session to the flag variant they were on without switching tools.
Session Replay
Log events in PostHog can be connected to the session and user who triggered them. Jump from a log line to a session replay in one click.


Product Analytics
Turn log patterns into trends, funnels, and retention insights. Know which logged errors actually hurt user retention vs. which are just noise.


Error Tracking
Logs with $exception events become issues you can assign, resolve, and alert on. No separate error tracking tool needed.


Use for free
PostHog's Logs is built to be cost-effective by default, with a generous free tier and transparent usage-based pricing. Since we don't charge per seat, more than 90% of companies use PostHog for free.
TL;DR 💸
- No credit card required to start
- First 50 GB of ingested logs per month are free
- Above 50 GB we have usage-based pricing at $0.25/GB with discounts
- Set billing limits to avoid surprise charges
- See our pricing page for more up-to-date details
That's it! You're ready to start integrating.