Hi folks,
I have logs folder in which different type of logs are generated , I am monitoring them by the below command
tail -f *.log
but I want that if exception come in any of the logs then it should be catch so what i should prefix with
tail -f *.log
so that it imeediatley catches and high light he exception if it comes , Please advise
You can use
grep -il <string you want to search for> *
or
grep -ic <string you want to search for> *
MR.bean
3
this would print everything and highlight the line containing the word "EXCEPTION"
tail -f *.log | awk '{ x=$0; if(/EXCEPTION/){ x= "\033[1;31m" $0 "\033[0m" } print x}'
replace EXCEPTION with the exception text you want to match against
this is giving an Exception...!!