One of the essential tools in my day-to-day toolbox is a simple local log viewing tool, when I was trying various tools out, I had three core requirements:
- It must be fast to load and be able to parse large log files.
- It must support live tailing of the log file, as the file is being written too I don’t want to refresh the app or re-load the file.
- It must be able to quickly search within the file. All too often I’m looking for a specific error or piece of log information that is going to help me diagnose the issue.
After trying out many tools, I’ve pretty much settled on glogg as my go-to local log viewer, it’s described by its authors as:
glogg is a multi-platform GUI application to browse and search through long or complex log files. It is designed with programmers and system administrators in mind. glogg can be seen as a graphical, interactive combination of grep and less.
Tabbed log files
Its almost a given these days that tools of this nature support tabbed files. This is great when you’re dealing with multiple interacting components.
This is probably the feature that I use the most, it’s just great. If you take a closer look at the screenshot above, you can see for the search that I’ve performed several visual indicators are present:
- In the bottom window a list of every line where the search criteria have matched, in this case I’ve chosen to ignore the case and also auto-refresh the search if additional log lines match the criteria appear. There’s also a count of how many matches have been found.
- The solid red dots in the left ‘gutter’ indicate that line matches the criteria.
- On the right hand ‘gutter’ the red dashes indicate how frequent or dense the match has been. This can be useful when you’re looking to establish patterns around time or perhaps how often a log event occurs.
Although I generally just use it to match a string value, the search box itself supports regular expressions and wildcards.
There is another search that I probably don’t use that often, this supports more of an instance-by-instance search where you can quickly navigate backwards and forwards between each match.
Another feature I configure almost immediately when I’m setting up the tool is ‘filters’, this feature gives you the ability to highlight individual log lines that match a search criterion with a chosen fore and back colour. From the screen shot below I’ve set up a several fairly generic filters that give me a quick way of scanning though a file for the log type I’m after. You can also see this highlighting in action in the first screenshot.
Of course, another great use of this is adding something quite specific to the log file you’re looking at. Perhaps you’d like to highlight in the file all occurrences of when the word ‘Chocolatey’ appears, this is where you’d do this.
If there’s one shortcut command you need to remember when using this tool, it’s just ‘
f‘. This toggles following and unfollowing a file as it receives more data. With following on, the main window will scroll, allowing you to view more logs as they appear. Want to stop it? Simply click ‘
f‘ again or grab the scroll bar indicator and drag it up slightly.
A feature which I use on occasion is the ability to mark a line, simply click on the dot in the left-hand gutter and a small arrow will appear. The line will then also be added to the search window to easily navigate back to (In this case I’ve cleared the search text to make this easier to see).
So, yeah, I’m a fan of glogg! I’ve been using it for a couple years now and all I can say if your looking to get away from using Notepad++ (another great tool but not really for log files) or plain ol’ notepad then I’d recommend giving glogg a spin, I don’t think you’ll be disappointed!