Over a million developers have joined DZone.

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++.

· DevOps Zone

The DevOps Zone is brought to you in partnership with Sonatype Nexus. The Nexus Suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

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.

The DevOps Zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today

Topics:
architects ,devops ,tools & methods

Published at DZone with permission of Dror Helper, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}