Documentation 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.
Log File Location
Crush logs all activity to a file located at:crush). Each project maintains its own separate log file.
Viewing Logs
Crush provides a convenientlogs command to view log output:
Basic Usage
View Specific Number of Lines
Use the--tail (or -t) flag to specify how many lines to show:
Follow Logs in Real-Time
Use the--follow (or -f) flag to stream logs as they’re written:
Ctrl+C to stop following.
Log Format
Logs are written in JSON format and rendered with timestamps and colors when viewed throughcrush logs. Each log entry includes:
- Timestamp: When the event occurred
- Level: Log level (
INFO,DEBUG,WARN,ERROR) - Message: Human-readable description
- Additional fields: Context-specific data (session ID, file paths, etc.)
Example Log Output
Debug Mode
Debug mode enables more verbose logging, which is helpful for troubleshooting issues.Enable with Flag
Run Crush with the--debug (or -d) flag:
Enable in Configuration
Add thedebug option to your crush.json:
What Debug Mode Logs
Debug mode captures additional information:- LSP server communication details
- MCP server interactions
- Tool execution details
- Configuration loading steps
- File system operations
- Provider API request/response metadata
LSP Debug Logging
For even more detailed LSP (Language Server Protocol) logging, use thedebug_lsp option:
- LSP initialization requests and responses
- LSP method calls and results
- LSP server startup and shutdown
- LSP diagnostics and errors
- Troubleshooting LSP server issues
- Debugging language-specific code intelligence problems
- Investigating slow LSP performance
Reading and Interpreting Logs
Log Levels
- INFO: Normal operation events (session created, prompt sent, etc.)
- DEBUG: Detailed diagnostic information (only visible in debug mode)
- WARN: Warning conditions that don’t prevent operation
- ERROR: Error conditions that may affect functionality
Common Log Patterns
Successful Session Flow
Provider Connection Issues
LSP Server Startup
Log File Management
Log Rotation
Crush does not automatically rotate log files. For long-running projects:Clearing Logs
To clear logs:Log File Size
Log files can grow large over time, especially with debug mode enabled. Monitor disk usage:Troubleshooting with Logs
Provider Authentication Issues
Look for:Tool Execution Failures
Look for:PATH.
LSP Server Crashes
Look for:Session Database Errors
Look for:Sharing Logs for Support
When reporting issues:-
Enable debug mode:
- Reproduce the issue
-
Extract relevant logs:
- Review for sensitive information (file paths, API keys, etc.)
- Share the log file with your issue report
Log Locations by Platform
The log file location is always relative to your project:Best Practices
- Use
crush logsinstead ofcat: The logs command formats output nicely and supports following - Enable debug mode when troubleshooting: More information helps diagnose issues
- Check logs after errors: Logs often contain more detail than UI error messages
- Clean up old logs periodically: Keep disk usage under control
- Don’t commit log files: Add
.crush/logs/to your.gitignore - Use
--tailto limit output: Large log files can be overwhelming
Advanced: Direct Log Access
You can also view logs directly with standard Unix tools:crush logs is recommended as it provides better formatting and filtering.