-
-
Save barryvdh/3790c881630475fd2f1ca93ccd35302a to your computer and use it in GitHub Desktop.
Tail Laravel logs and filter out the stack traces using https://deployer.org/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc('Tail your laravel.log file'); | |
task('tail', function () { | |
$numLines = isVerbose() ? '100' : '1000'; | |
$tail = "tail -n {$numLines} {{deploy_path}}/current/storage/logs/laravel*.log "; | |
if (!isVerbose()) { | |
// Change -P to -E, depending on OS or grep version. | |
$tail .= '| grep -i -P "^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" | tail -n 100 '; | |
} | |
$output = run($tail); | |
writeln($output); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment