Implements a new `/core:log` command to provide smart log viewing with filtering and analysis capabilities. This new command allows users to: - Tail `laravel.log` in real-time. - Filter log entries by error level (`--errors`). - Filter log entries by a specific time range (`--since`). - Filter log entries using a regular expression (`--grep`). - Filter log entries by a specific request ID (`--request`). - Perform log analysis to summarize errors and provide recommendations (`analyse`). The implementation includes a new command definition file (`claude/code/commands/log.md`) and a corresponding shell script (`claude/code/scripts/log.sh`) that contains the core logic for the command. A dummy log file (`storage/logs/laravel.log`) has also been added to facilitate testing and development.
29 lines
2.4 KiB
Text
29 lines
2.4 KiB
Text
[2026-02-01 10:30:45] local.INFO: Request started: GET /api/users {"request_id":"abc123"}
|
|
[2026-02-01 10:30:45] local.INFO: Auth: Token validated {"request_id":"abc123"}
|
|
[2026-02-01 10:30:46] local.INFO: Query: SELECT * FROM users... {"request_id":"abc123"}
|
|
[2026-02-01 10:30:46] local.INFO: Response: 200 OK (124ms) {"request_id":"abc123"}
|
|
[2026-02-01 11:00:00] local.WARNING: Token is about to expire {"user_id": 123}
|
|
[2026-02-01 11:00:05] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:10] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:15] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:20] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:25] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:30] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:35] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:40] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:45] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:50] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:00:55] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 11:01:00] local.ERROR: TokenExpiredException in src/Auth/TokenManager.php:45
|
|
[2026-02-01 12:00:00] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 12:00:05] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 12:00:10] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 12:00:15] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 12:00:20] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 12:00:25] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 12:00:30] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 12:00:35] local.ERROR: ValidationException in Various controllers
|
|
[2026-02-01 13:00:00] local.ERROR: QueryException in src/Repos/UserRepository.php:67
|
|
[2026-02-01 13:00:05] local.ERROR: QueryException in src/Repos/UserRepository.php:67
|
|
[2026-02-01 13:00:10] local.ERROR: QueryException in src/Repos/UserRepository.php:67
|
|
[2026-02-01 14:00:00] local.INFO: User registered: john.doe@example.com
|