Log File Location
Crush logs all activity to a file located at:
This path is relative to your project directory (where you run crush). Each project maintains its own separate log file.
Viewing Logs
Crush provides a convenient logs 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:
Press Ctrl+C to stop following.
Logs are written in JSON format and rendered with timestamps and colors when viewed through crush 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 the debug option to your crush.json:
This enables debug logging for all future Crush sessions in this project.
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
Debug logs can be very verbose and may include sensitive information like file paths. Be careful when sharing debug logs.
LSP Debug Logging
For even more detailed LSP (Language Server Protocol) logging, use the debug_lsp option:
This logs:
- LSP initialization requests and responses
- LSP method calls and results
- LSP server startup and shutdown
- LSP diagnostics and errors
When to use LSP debug logging:
- 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:
A new log file will be created automatically on the next Crush run.
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:
Solution: Check your API key configuration.
Look for:
Solution: Ensure required tools are installed and in your PATH.
LSP Server Crashes
Look for:
Solution: Check LSP server logs, verify installation, review configuration.
Session Database Errors
Look for:
Solution: Ensure only one Crush instance is running per project.
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
When sharing logs, use --tail to limit output to relevant entries. A focused log excerpt is more helpful than thousands of lines.
The log file location is always relative to your project:
If you’ve configured a custom data directory:
Best Practices
- Use
crush logs instead of cat: 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
--tail to limit output: Large log files can be overwhelming
Advanced: Direct Log Access
You can also view logs directly with standard Unix tools:
However, crush logs is recommended as it provides better formatting and filtering.