Tip: Using Notepad++ to read log files

Monday, June 10, 2013

I had to read a log file containing a few hundred lines today at work.

My first instinct was to open it using my trusty Notepad++. While the file was not huge it was still difficult to traverse it and my eyes kept jumping between lines. Finding the  errors and warning was proving to be a hard task.

Since each line started with the severity of the message (trace/debug/info/warning/error) all I was missing was basic text highlighting – now where can I find such a tool :)

image

 

I’ve set out for work - the only question being – how hard would it be (spoiler: easy).

 

Step 1 – under Language choose Define your language

image

 

A new dialog will be opened. If you prefer you can dock it to the screen.

Choose Keywords tab

image

 

Define new keywords for Error, Warning  and any other severity you wish to highlight.

Choose the Styler button and set custom background (or foreground) for each severity.

image

 

And finally use Save as and name your new “language” – and a new language is born.

image

 

This is what the log looks like now – easy to read and spot the errors. I only wish I could have marked the whole line but at least now I can tell where the errors are.

image

 

Not too bad for less than one minute of work.

4 comments

  1. use chainsaw or one of the other log viewer and save that minute of work and get better view of your log. http://logging.apache.org/chainsaw/download.html

    ReplyDelete
  2. That's great ! Thanks a lot !

    ReplyDelete
  3. Hi, thanks for the tip, fun ! I use Baretail http://geekswithblogs.net/robz/archive/2008/05/09/baretail---log-file-monitoring-tool.aspx for reading logs. Bonus for baretail is that it is very very fast for very very large logfiles and it tails the log so you can monitor it real-time.

    ReplyDelete
  4. Grimace of Despair20 December 2013 at 12:37

    Thumbs up for Baretail. My favourite too, and it even has a free version which servers the most basic needs.

    ReplyDelete

Newer Older
Related Posts Plugin for WordPress, Blogger...