Skip to content

Instantly share code, notes, and snippets.

@jaytaph
Created January 4, 2017 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jaytaph/cea416b40ee851dfa38954d91cf5057d to your computer and use it in GitHub Desktop.
Save jaytaph/cea416b40ee851dfa38954d91cf5057d to your computer and use it in GitHub Desktop.
# Display Symfony2 logging with different coloring for different error levels
tail -f var/logs/*.log | gawk '
/ERROR/ { print "\033[31m" $0 "\033[39;0m"; next; fflush();}
/CRITICAL/ { print "\033[41;33;1m" $0 "\033[39;0m"; next; fflush();}
/DEBUG/ { print "\033[34;1m" $0 "\033[39;0m"; next; fflush();}
/INFO/ { print "\033[32;1m" $0 "\033[39;0m"; next; fflush();}
$0; fflush();
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment