Skip to content

Troubleshooting

Nicholas Cheek edited this page Jun 14, 2025 · 1 revision

Troubleshooting

Common issues and solutions when using Laravel Log Parser.

Installation Issues

Command Not Found

bash: logparse: command not found

Solutions:

  1. Verify installation location: which logparse
  2. Check PATH: echo $PATH
  3. Reinstall to correct location: sudo mv logparse /usr/local/bin/
  4. Refresh shell: source ~/.bashrc or source ~/.zshrc

Permission Denied

Permission denied: /usr/local/bin/logparse

Solutions:

  1. Make executable: sudo chmod +x /usr/local/bin/logparse
  2. Check ownership: ls -la /usr/local/bin/logparse
  3. Reinstall with proper permissions

SSH Connection Issues

Host Not Found

SSH config error: Host "production" not found

Solutions:

  1. Check SSH config exists: ls -la ~/.ssh/config
  2. Verify host alias: grep -A5 "Host production" ~/.ssh/config
  3. Test SSH manually: ssh production "echo test"
  4. Check config syntax: ssh -F ~/.ssh/config -T production

Permission Denied (SSH)

SSH command failed: Permission denied (publickey)

Solutions:

  1. Check SSH key permissions: chmod 600 ~/.ssh/your-key.pem
  2. Add key to SSH agent: ssh-add ~/.ssh/your-key.pem
  3. Test SSH connection: ssh -v production
  4. Verify SSH config: Host production IdentityFile ~/.ssh/your-key.pem IdentitiesOnly yes

Connection Timeout

SSH command failed: connection timed out

Solutions:

  1. Check network connectivity: ping hostname
  2. Test direct SSH: ssh -o ConnectTimeout=10 production
  3. Verify firewall rules
  4. Check SSH daemon status on remote server

Log Parsing Issues

No Entries Found

No log entries found matching your criteria

Debugging steps:

  1. Check if file exists: logparse --last=1 target
  2. Verify log format matches Laravel standard
  3. Check date filters: logparse --since=2020-01-01 target
  4. Test without filters: logparse target

Token Too Long Error

bufio.Scanner: token too long

Solutions:

  1. Log entry exceeds buffer size (very large stack traces)
  2. Update to latest version (buffer size increased)
  3. Split large log files: split -l 10000 laravel.log

Invalid Date Format

Warning: invalid since date format

Correct formats:

  • 2024-01-15
  • 2024-01-15 14:30
  • ISO format: 2024-01-15T14:30:00

Performance Issues

Slow Remote Parsing

Optimizations:

  1. Use time filters: --since=today
  2. Limit results: --last=1000
  3. Filter on server side first: ssh production "tail -1000 storage/logs/laravel.log" | logparse /dev/stdin

Memory Usage

For very large files:

  1. Use --last=N to limit entries
  2. Apply filters to reduce dataset
  3. Process in smaller chunks

Output Issues

No Colors

Check:

  1. Terminal supports colors: echo $TERM
  2. Not piping output: logparse target | less -R
  3. Force colors: Remove --no-color flag

Garbled Output

Solutions:

  1. Check terminal encoding: locale
  2. Use --no-color flag
  3. Pipe through cat: logparse target | cat

Integration Issues

JSON Output Problems

Test JSON validity

logparse --json target | jq '.'

Common issue: mixed output

logparse --json --no-color target

Script Integration

Capture errors properly

if ! logparse --errors-only production > /dev/null 2>&1; then echo "Log parsing failed" exit 1 fi

Debug Mode

Enable verbose output for troubleshooting:

SSH debugging

ssh -v production "cat storage/logs/laravel.log" | logparse /dev/stdin

Show all processing steps

logparse --debug target # (if implemented)

Getting Help

Check Version

logparse --version

Report Issues

When reporting bugs, include:

  1. Operating system and version
  2. Command that failed
  3. Error message
  4. Sample log entry (anonymized)
  5. SSH config (anonymized)

Log Format Validation

Verify your logs match the expected format: [YYYY-MM-DD HH:MM:SS] environment.LEVEL: message

Example valid entry: [2024-01-15 14:30:45] production.ERROR: Call to undefined method App\Models\User::nonExistentMethod()

Common Solutions Summary

Problem Quick Fix Command not found sudo mv logparse /usr/local/bin/ SSH fails Test with ssh hostname first No results Remove filters, check dates Slow performance Add --last=100 No colors Remove --no-color JSON invalid Add --no-color

Clone this wiki locally