Logging with Beacon
Log Levels
| Level | Use Case |
|---|---|
debug | Development debugging, verbose info |
info | Normal operations, user actions |
warn | Potential issues, degraded performance |
error | Failures that need attention |
Structured Logging
Include structured data for better searching:User Context
Logs automatically include user context if set:Viewing Logs
View logs in Dashboard > Beacon > Logs:- Filter by level, service, time range
- Search log messages and data
- Group by user or session
- Export for analysis
Log Retention
| Plan | Retention |
|---|---|
| Starter | 7 days |
| Pro | 30 days |
| Team | 90 days |
Best Practices
Log meaningful events
Log meaningful events
Focus on events that help debugging: user actions, API calls, state changes.
Include context
Include context
Add relevant data like IDs, counts, and durations.
Use appropriate levels
Use appropriate levels
Reserve
error for actual failures, use warn for issues that don’t block users.Avoid sensitive data
Avoid sensitive data
Never log passwords, tokens, or PII.