TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/charmbracelet/crush/llms.txt
Use this file to discover all available pages before exploring further.
crush logs command displays Crush’s application logs, useful for debugging, monitoring, and troubleshooting issues.
Usage
Description
View the logs generated by Crush. This command provides access to detailed log output including:- Application events
- Debug information
- Error messages
- API calls
- Tool executions
- Session lifecycle
Flags
Follow log output in real-time. Similar to
tail -f, this continuously displays new log entries as they’re written.Short flag: -fShow only the last N lines. Default is 1000 lines for performance.Short flag:
-tGlobal Flags
Current working directory. Used to locate the project’s Crush data directory.
Custom Crush data directory containing the logs.
--debug
Log File Location
Logs are stored at:Examples
Output Format
Logs are displayed with structured formatting:Example Log Output
Log Levels
Logs are categorized by severity:- DEBUG: Detailed diagnostic information
- INFO: General informational messages
- WARN: Warning messages (non-critical issues)
- ERROR: Error messages (failures and exceptions)
Structured Fields
Each log entry may include structured fields:session_id: Unique session identifierprovider: AI provider namemodel: Model being usedtool: Tool namefile: File patherror: Error messagesource: Source code location (file:line)
Log Format
Logs are stored in JSON format but displayed with human-readable formatting:Raw JSON (in file)
Formatted Display
Following Logs
When using--follow:
- Initial display: Shows the last N lines (from
--tail) - Follow mode: Continuously displays new entries
- Exit: Press
Ctrl+Cto stop following
Example Flow
Use Cases
Debugging Issues
When something goes wrong:Monitoring Active Sessions
Watch what Crush is doing:Performance Analysis
Analyze timing and performance:Tool Execution Tracking
See which tools are being used:Searching Logs
Combine with standard Unix tools:Grep Examples
Filter by Time Range
Count Occurrences
Error Messages
No Logs Found
Failed to Get Flag
Failed to Tail Log File
Performance Considerations
Default Tail Limit
The default--tail 1000 limit is for performance:
- Prevents loading massive log files into memory
- Provides quick startup time
- Usually sufficient for debugging
Large Log Files
If log files grow very large:Following Performance
When following logs:- Minimal CPU usage in idle state
- Near-instant display of new entries
- Efficient file watching
Log Rotation
Crush doesn’t automatically rotate logs. To manage log files:Manual Rotation
Using Logrotate
Create/etc/logrotate.d/crush:
Log Verbosity
Control log verbosity through:Debug Mode
Environment Variables
Set log level via environment:Privacy & Security
Sensitive Information
Logs may contain:- File paths
- Command-line arguments
- Error messages
- API response snippets
- API keys (redacted)
- Full file contents
- Complete API responses
- Authentication tokens
Sharing Logs
When sharing logs for debugging:See Also
crush stats- View usage statisticscrush --debug- Enable debug logging- Logging Guide - Complete logging guide
- Configuration - Configure logging behavior