Using Chainsaw Log Viewer with Log4Net

I just found via Michael Flanakin's Web Log that you can use the tool, a GUI based log viewer from Log4J project, with the Log4Net enabled applications. Here what you need to do:

1. First download the application from the above link. It requires Java. I know it sucks. But don't be put off just yet.

2. Then in the config file of your.NET application add following appender:

                 

                 ...   

Note the special type of layout used to format XML messages.

3. Finally create a config file with following content:

<log4j:configuration  xmlns:log4j="http://jakarta.apache.org/log4j/"  debug="false">                </log4j:configuration>

When you start Chainsaw and it asks you for configuration (Warning: no receivers defined) select the third option (Let me search for configuration file) and browse for the config file you just created.

4. Start your application and you should see your loggers added in logger tree panel on the chainsaw-log tab. You can filter to see messages only from your logger by right-clicking on it and selecting “Focus on '...' “ option from the menu.

If you can't stand running Java application on your computer the you can try the written by Naumtsev Taras. It has far less capabilities but is sufficient for most tasks.

This article is part of the GWB Archives. Original Author: Szymon Kobalczyk

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.