-
Notifications
You must be signed in to change notification settings - Fork 0
Command Reference
Complete reference for all Laravel Log Parser commands and options.
logparse [OPTIONS] TARGET
Where TARGET is either:
- Local file path: storage/logs/laravel.log
- SSH host alias: production
TARGET Local file path or SSH host alias --remote-path=PATH Remote log file path (default: storage/logs/laravel.log) --ssh-config=PATH SSH config file path (default: ~/.ssh/config)
--level=LEVEL Filter by log level (DEBUG, INFO, WARNING, ERROR) --errors-only Show only ERROR and WARNING entries --since=DATE Show logs since date (YYYY-MM-DD or "YYYY-MM-DD HH:MM") --until=DATE Show logs until date (YYYY-MM-DD or "YYYY-MM-DD HH:MM") --search=TEXT Search for text in log messages (case-insensitive) --user=ID Filter by user ID --last=N Show only the last N entries
--summary Show summary statistics --stats Show detailed statistics with user and file analysis --group-by=FIELD Group results by: message, level, file, user --json Output in JSON format --compact Use compact one-line format --no-color Disable colored output
--help Show help message --version Show version information
logparse storage/logs/laravel.log
logparse production
logparse --help
logparse --errors-only --last=50 production
logparse --search="Call to undefined method" --errors-only production
logparse --user=123 --errors-only --since=today production
logparse --since=2024-01-15 production
logparse --since="2024-01-15 14:00" --until="2024-01-15 16:00" production
logparse --last=100 production
logparse --summary production
logparse --stats --since=today production
logparse --errors-only --group-by=message production
logparse --json --since=today production > logs.json
logparse --compact --errors-only production
logparse --no-color production
logparse --remote-path="app/logs/laravel.log" production
logparse --ssh-config="/etc/ssh/ssh_config" production
- 0 - Success
- 1 - General error (invalid arguments, file not found)
- 2 - SSH connection failed
- 3 - Log parsing error
Laravel Log Parser supports the standard Laravel log format:
[YYYY-MM-DD HH:MM:SS] environment.LEVEL: message {"context":"data"}
Examples: [2024-01-15 14:30:45] production.ERROR: Call to undefined method {"userId":123} [2024-01-15 14:30:46] production.INFO: User logged in {"userId":456,"ip":"192.168.1.1"}
export NO_COLOR=1
export SSH_CONFIG_FILE="/path/to/config"
logparse --json production | jq '.[] | select(.level == "ERROR")'
logparse production | grep -i "database"
logparse --compact production | awk '/ERROR/ {print $3, $4}'
#!/bin/bash ERROR_COUNT=$(logparse --errors-only --since=today production | wc -l) if [ $ERROR_COUNT -gt 10 ]; then echo "High error rate detected: $ERROR_COUNT errors today" fi