I follow multiple log files like this:
tail -f /var/log/apache2/tv7r9r3falz0_error.log protected/runtime/application.log
Is there a way to color each file so I don't have to rely on finding the headers:
==> protected/runtime/application.log <==
I know about multitail
, but I want to freely scroll.
This will print the output in two different colors depending on which log file it comes from:
tail -f log1 log2 | awk $'/==> log1/{print "\033[0m\033[1;33;40m";} /==> log2/{print "\033[0m\033[1;35;40m";} 1'
Update by Elliot Chance: Thats the start I needed, here was the working version:
tail -f /var/log/apache2/tv7r9r3falz0_error.log protected/runtime/application.log | awk '/==> /{print "\033[0m\033[1;36;40m";} /==> p/{print "\033[0m\033[1;33;40m";} {print $0}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With