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