Skip to main content
The 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
Logs are formatted with colors and structured fields for easy reading.

Flags

boolean
default:"false"
Follow log output in real-time. Similar to tail -f, this continuously displays new log entries as they’re written.Short flag: -f
integer
default:"1000"
Show only the last N lines. Default is 1000 lines for performance.Short flag: -t

Global Flags

string
default:"current directory"
Current working directory. Used to locate the project’s Crush data directory.
string
default:"~/.crush"
Custom Crush data directory containing the logs.
Other global flags are also available: --debug

Log File Location

Logs are stored at:
Or, if using a custom data directory:

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 identifier
  • provider: AI provider name
  • model: Model being used
  • tool: Tool name
  • file: File path
  • error: Error message
  • source: 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:
  1. Initial display: Shows the last N lines (from --tail)
  2. Follow mode: Continuously displays new entries
  3. Exit: Press Ctrl+C to 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

Cause: Log file doesn’t exist at the expected location. Solution:

Failed to Get Flag

Cause: Internal flag parsing error. Solution: Check your command syntax.

Failed to Tail Log File

Cause: Permission issue or file is locked. Solution:

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
Not logged:
  • API keys (redacted)
  • Full file contents
  • Complete API responses
  • Authentication tokens

Sharing Logs

When sharing logs for debugging:

See Also