Sunday, September 30, 2012

Scanning the logs with grep

From time to time I'm analyzing the applications logs to troubleshoot possible bugs of a system.
While you have plenty of logs you need a tool, a fast one to parse the and give you a result.

I believe this tool is a grep. You can even install it on Windows, what actually did for one of my laptops.
But it's not enough to have a tool, you have to know how to use it properly. So enjoy this article - the helpfull one

I'm personally in love with -C # option. My the most often used command is:

grep -C 2 "PATTERN_OR_REGEXP" application.log*

This usually gives me information about what preceeded the error and where the Exception was raised.

No comments:

Post a Comment