Last active
May 3, 2016 12:13
-
-
Save gedex/0f465c9dba7bf5261a7d55b9cd770a6d to your computer and use it in GitHub Desktop.
Colorized PHP logs via tail
This file contains hidden or 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
coloirzed_tail() { | |
tail -100f $1 | awk ' | |
/PHP Fatal/ {print "\033[1;31m" $0 "\033[39m"; next} | |
/WordPress database error/ {print "\033[1;31m" $0 "\033[39m"; next} | |
/PHP Notice/ {print "\033[1;33m" $0 "\033[39m"; next} | |
/PHP Warning/ {print "\033[1;33m" $0 "\033[39m"; next} | |
1 {print} | |
' | |
} | |
alias tlog="coloirzed_tail /srv/log/php_errors.log" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment