Fullstory Logging API
Implementation Files: This document covers core concepts. For code examples, see:
Overview
Fullstory's Logging API allows developers to send log messages directly to Fullstory sessions. These logs appear in the session replay, providing valuable context for debugging user issues, tracking application state, and understanding user workflows—without cluttering the device's console or logging systems.
Key use cases:
- Error Context: Log errors with stack traces viewable in replay
- Application State: Record important state changes
- Debugging: Add contextual information during development
- Audit Trail: Log significant user actions
- Support Context: Add logs that support teams can see in sessions
Core Concepts
Log Levels
All platforms support the same log levels, though the syntax differs:
| Level |
Use For |
Severity |
log |
General information |
Lowest |
info |
Informational messages |
Low |
warn |
Warning conditions |
Medium |
error |
Error conditions |
High |
debug |
Debug information |
Varies |
Key Behaviors
| Behavior |
Description |
| Session-only |
Logs appear in Fullstory session replay, not device console |
| Session context |
Logs viewable in session replay timeline |
| Timestamped |
Automatically timestamped by Fullstory |
| Searchable |
Can search sessions by log content |
| String messages |
All platforms require string messages |
When to Use FS Logging vs Device Console
| Use FS Logging |
Use Device Console |
| Production errors you want in replay |
Development-only debugging |
| State changes for support context |
Verbose tracing during development |
| User action audit trails |
Performance timing logs |
| Integration errors |
Internal debugging |
| Customer-facing error context |
CI/CD diagnostics |
Data Privacy
Never log sensitive data:
- ❌ Passwords, API keys, tokens
- ❌ Credit card numbers, CVVs
- ❌ Social Security numbers
- ❌ Personal health information
- ❌ Full email addresses (use user IDs instead)
Safe to log:
- ✅ User IDs (non-PII identifiers)
- ✅ Action names and types
- ✅ Error messages and codes
- ✅ Application state indicators
- ✅ Timing and performance metrics
Best Practices
1. Use Appropriate Log Levels
debug → Development troubleshooting, verbose details
log → General operational information
info → Significant but normal events
warn → Potential issues, degraded functionality
error → Failures requiring attention
2. Structure Log Messages Consistently
- Include context: action name, identifiers, state
- Use consistent prefixes for categorization:
[Auth], [Payment], [API]
- Include relevant IDs for correlation
- Keep messages concise but informative
3. Log Strategically
Good to log:
- API failures and errors
- Authentication events (login/logout)
- Critical user actions (checkout, form submit)
- State transitions
- Third-party integration events
Avoid logging:
- Every mouse movement or scroll
- High-frequency events in loops
- Sensitive/PII data
- Redundant information
4. Create Centralized Logging Utilities
Build wrapper functions that:
- Add consistent formatting
- Include timestamps and context
- Check for Fullstory availability
- Sanitize potentially sensitive data
Rate Limits and Constraints
| Constraint |
Limit |
| Message type |
String only (no objects) |
| Rate limiting |
Standard API rate limits apply |
| Excessive logging |
May be throttled |
| Message length |
Keep concise; very long messages may be truncated |
Common Patterns
Error Logging Pattern
- Capture error details (message, type, stack)
- Add context (action, state, identifiers)
- Format as readable string
- Send to Fullstory with
error level
- Optionally send to other error tracking services
Audit Trail Pattern
- Define standard action format
- Include timestamp, action name, details
- Use
info level for normal operations
- Use
warn for unusual but valid actions
- Use
error for failed operations
Integration Logging Pattern
- Log connection attempts
- Log successful connections
- Log disconnections with reasons
- Log errors with operation context
- Log timeouts with duration
Key Takeaways for Agent
When helping developers implement Fullstory logging:
Always emphasize:
- Message format: Always pass strings, not objects or arrays
- Privacy: Never log PII, passwords, or sensitive data
- Log levels: Use appropriate severity levels
- Frequency: Log significant events, not every operation
Common mistakes to watch for:
- Logging objects instead of strings
- Including PII in log messages
- Excessive logging causing noise
- Using wrong log levels
Platform routing:
- Web (JavaScript/TypeScript) → See SKILL-WEB.md
- iOS (Swift) → See SKILL-MOBILE.md § iOS
- Android (Kotlin) → See SKILL-MOBILE.md § Android
- Flutter (Dart) → See SKILL-MOBILE.md § Flutter
- React Native → See SKILL-MOBILE.md § React Native
Reference Links
1---2name: fullstory-logging3description: Core concepts for Fullstory's Logging API. Platform-agnostic guide covering log levels, message formatting, privacy considerations, and best practices. See SKILL-WEB.md and SKILL-MOBILE.md for implementation examples.4---56# Fullstory Logging API78> **Implementation Files**: This document covers core concepts. For code examples, see:9> - [SKILL-WEB.md](./SKILL-WEB.md) — JavaScript/TypeScript (Browser)10> - [SKILL-MOBILE.md](./SKILL-MOBILE.md) — iOS, Android, Flutter, React Native1112## Overview1314Fullstory's Logging API allows developers to send log messages directly to Fullstory sessions. These logs appear in the session replay, providing valuable context for debugging user issues, tracking application state, and understanding user workflows—without cluttering the device's console or logging systems.1516Key use cases:17- **Error Context**: Log errors with stack traces viewable in replay18- **Application State**: Record important state changes19- **Debugging**: Add contextual information during development20- **Audit Trail**: Log significant user actions21- **Support Context**: Add logs that support teams can see in sessions2223---2425## Core Concepts2627### Log Levels2829All platforms support the same log levels, though the syntax differs:3031| Level | Use For | Severity |32|-------|---------|----------|33| `log` | General information | Lowest |34| `info` | Informational messages | Low |35| `warn` | Warning conditions | Medium |36| `error` | Error conditions | High |37| `debug` | Debug information | Varies |3839### Key Behaviors4041| Behavior | Description |42|----------|-------------|43| **Session-only** | Logs appear in Fullstory session replay, not device console |44| **Session context** | Logs viewable in session replay timeline |45| **Timestamped** | Automatically timestamped by Fullstory |46| **Searchable** | Can search sessions by log content |47| **String messages** | All platforms require string messages |4849### When to Use FS Logging vs Device Console5051| Use FS Logging | Use Device Console |52|----------------|-------------------|53| Production errors you want in replay | Development-only debugging |54| State changes for support context | Verbose tracing during development |55| User action audit trails | Performance timing logs |56| Integration errors | Internal debugging |57| Customer-facing error context | CI/CD diagnostics |5859---6061## Data Privacy6263**Never log sensitive data:**64- ❌ Passwords, API keys, tokens65- ❌ Credit card numbers, CVVs66- ❌ Social Security numbers67- ❌ Personal health information68- ❌ Full email addresses (use user IDs instead)6970**Safe to log:**71- ✅ User IDs (non-PII identifiers)72- ✅ Action names and types73- ✅ Error messages and codes74- ✅ Application state indicators75- ✅ Timing and performance metrics7677---7879## Best Practices8081### 1. Use Appropriate Log Levels8283```84debug → Development troubleshooting, verbose details85log → General operational information86info → Significant but normal events87warn → Potential issues, degraded functionality88error → Failures requiring attention89```9091### 2. Structure Log Messages Consistently9293- Include context: action name, identifiers, state94- Use consistent prefixes for categorization: `[Auth]`, `[Payment]`, `[API]`95- Include relevant IDs for correlation96- Keep messages concise but informative9798### 3. Log Strategically99100**Good to log:**101- API failures and errors102- Authentication events (login/logout)103- Critical user actions (checkout, form submit)104- State transitions105- Third-party integration events106107**Avoid logging:**108- Every mouse movement or scroll109- High-frequency events in loops110- Sensitive/PII data111- Redundant information112113### 4. Create Centralized Logging Utilities114115Build wrapper functions that:116- Add consistent formatting117- Include timestamps and context118- Check for Fullstory availability119- Sanitize potentially sensitive data120121---122123## Rate Limits and Constraints124125| Constraint | Limit |126|------------|-------|127| Message type | String only (no objects) |128| Rate limiting | Standard API rate limits apply |129| Excessive logging | May be throttled |130| Message length | Keep concise; very long messages may be truncated |131132---133134## Common Patterns135136### Error Logging Pattern1371381. Capture error details (message, type, stack)1392. Add context (action, state, identifiers)1403. Format as readable string1414. Send to Fullstory with `error` level1425. Optionally send to other error tracking services143144### Audit Trail Pattern1451461. Define standard action format1472. Include timestamp, action name, details1483. Use `info` level for normal operations1494. Use `warn` for unusual but valid actions1505. Use `error` for failed operations151152### Integration Logging Pattern1531541. Log connection attempts1552. Log successful connections1563. Log disconnections with reasons1574. Log errors with operation context1585. Log timeouts with duration159160---161162## Key Takeaways for Agent163164When helping developers implement Fullstory logging:1651661. **Always emphasize**:167 - Message format: Always pass strings, not objects or arrays168 - Privacy: Never log PII, passwords, or sensitive data169 - Log levels: Use appropriate severity levels170 - Frequency: Log significant events, not every operation1711722. **Common mistakes to watch for**:173 - Logging objects instead of strings174 - Including PII in log messages175 - Excessive logging causing noise176 - Using wrong log levels1771783. **Platform routing**:179 - Web (JavaScript/TypeScript) → See SKILL-WEB.md180 - iOS (Swift) → See SKILL-MOBILE.md § iOS181 - Android (Kotlin) → See SKILL-MOBILE.md § Android182 - Flutter (Dart) → See SKILL-MOBILE.md § Flutter183 - React Native → See SKILL-MOBILE.md § React Native184185---186187## Reference Links188189- **Web Logging**: https://developer.fullstory.com/browser/fullcapture/logging/190- **iOS Logging**: https://developer.fullstory.com/mobile/ios/logging/191- **Android Logging**: https://developer.fullstory.com/mobile/android/logging/192- **Help Center - Console Logs**: https://help.fullstory.com/hc/en-us/articles/360020623154