Tip: Using Notepad++ to read log files

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 thoughts on “Tip: Using Notepad++ to read log files

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

Leave a Reply