-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Common issues and solutions when using Laravel Log Parser.
bash: logparse: command not found
Solutions:
- Verify installation location: which logparse
- Check PATH: echo $PATH
- Reinstall to correct location: sudo mv logparse /usr/local/bin/
- Refresh shell: source ~/.bashrc or source ~/.zshrc
Permission denied: /usr/local/bin/logparse
Solutions:
- Make executable: sudo chmod +x /usr/local/bin/logparse
- Check ownership: ls -la /usr/local/bin/logparse
- Reinstall with proper permissions
SSH config error: Host "production" not found
Solutions:
- Check SSH config exists: ls -la ~/.ssh/config
- Verify host alias: grep -A5 "Host production" ~/.ssh/config
- Test SSH manually: ssh production "echo test"
- Check config syntax: ssh -F ~/.ssh/config -T production
SSH command failed: Permission denied (publickey)
Solutions:
- Check SSH key permissions: chmod 600 ~/.ssh/your-key.pem
- Add key to SSH agent: ssh-add ~/.ssh/your-key.pem
- Test SSH connection: ssh -v production
- Verify SSH config: Host production IdentityFile ~/.ssh/your-key.pem IdentitiesOnly yes
SSH command failed: connection timed out
Solutions:
- Check network connectivity: ping hostname
- Test direct SSH: ssh -o ConnectTimeout=10 production
- Verify firewall rules
- Check SSH daemon status on remote server
No log entries found matching your criteria
Debugging steps:
- Check if file exists: logparse --last=1 target
- Verify log format matches Laravel standard
- Check date filters: logparse --since=2020-01-01 target
- Test without filters: logparse target
bufio.Scanner: token too long
Solutions:
- Log entry exceeds buffer size (very large stack traces)
- Update to latest version (buffer size increased)
- Split large log files: split -l 10000 laravel.log
Warning: invalid since date format
Correct formats:
- 2024-01-15
- 2024-01-15 14:30
- ISO format: 2024-01-15T14:30:00
Optimizations:
- Use time filters: --since=today
- Limit results: --last=1000
- Filter on server side first: ssh production "tail -1000 storage/logs/laravel.log" | logparse /dev/stdin
For very large files:
- Use --last=N to limit entries
- Apply filters to reduce dataset
- Process in smaller chunks
Check:
- Terminal supports colors: echo $TERM
- Not piping output: logparse target | less -R
- Force colors: Remove --no-color flag
Solutions:
- Check terminal encoding: locale
- Use --no-color flag
- Pipe through cat: logparse target | cat
logparse --json target | jq '.'
logparse --json --no-color target
if ! logparse --errors-only production > /dev/null 2>&1; then echo "Log parsing failed" exit 1 fi
Enable verbose output for troubleshooting:
ssh -v production "cat storage/logs/laravel.log" | logparse /dev/stdin
logparse --debug target # (if implemented)
logparse --version
When reporting bugs, include:
- Operating system and version
- Command that failed
- Error message
- Sample log entry (anonymized)
- SSH config (anonymized)
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()
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