Created
November 19, 2012 21:11
-
-
Save michaeltwofish/4113926 to your computer and use it in GitHub Desktop.
Last php error
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
lasterror () { | |
logpath=/usr/local/www-conf/logs/$1-phplog | |
error=(${(f)$(awk -F: '/PHP Fatal error|\[error\]/ { lines[last] = NR } END { print lines[last] }' $logpath)}) | |
[[ -n $error ]] && tail -n +$error $logpath | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment