Thursday, August 20, 2015

linux - Making log output more readable in terminal

I'm currently developing with Wordpress and monitoring its debug.log file which updates on every page re-load. If there's an error, it will add those lines to the debug.log on refresh. The three basic possibilities are it outputs 0 lines(no errors), 1 line(1 error), or multiple lines(multiple errors).


Currently, I have tried tail -f and/or less +F as pagers to watch for new errors upon page re-load. My problem is that I want a way to make the output more readable. At present, each of these commands just adds additional log lines to the existing list. There isn't really differentiation between lines besides the time stamp on each.


I would love a way to be able to clearly and quickly see which lines(if any) were the most recently generated - i.e. from the latest page refresh. I've looked into appending new lines/line breaks between each output, or a way to highlight the most recent line(s), etc. but don't seem to be turning up many results.


I'm open to using other commands, bash scripts, etc. I just need a way to clearly display which are the new lines in a particular log file(per page refresh). All help is appreciated!

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...