Szymon Kobalczyk's Blog

A Developer's Notebook

  Home  |   Contact  |   Syndication    |   Login
  106 Posts | 6 Stories | 578 Comments | 365 Trackbacks

News

View Szymon Kobalczyk's profile on LinkedIn

Twitter












Tag Cloud


Article Categories

Archives

Post Categories

Blogs I Read

Tools I Use

I just found via Michael Flanakin's Web Log that you can use the Chainsaw 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:

<log4net>
<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
     <param name="RemoteAddress" value="127.0.0.1" />
     <param name="RemotePort" value="8080" />
     <layout type="log4net.Layout.XmlLayoutSchemaLog4j, log4net" />
  </appender>
  <root>
     <priority value="ALL" />
     <appender-ref ref="UdpAppender" />
     ...
  </root>
</log4net>

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

3. Finally create a config file with following content:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration
 xmlns:log4j="http://jakarta.apache.org/log4j/"
 debug="false">
    <plugin name="UDPReceiver"
class="org.apache.log4j.net.UDPReceiver">
       <param name="Port" value="8080" />
    </plugin>
</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 Log4Net Viewer written by Naumtsev Taras. It has far less capabilities but is sufficient for most tasks.

posted on Friday, July 15, 2005 6:55 AM

Feedback

# re: Using Chainsaw Log Viewer with Log4Net 7/28/2005 2:26 PM boris
Witam,

if you use UDP appender, you might lose log messages.

# re: Using Chainsaw Log Viewer with Log4Net 7/28/2005 3:51 PM Szymon
That is why I always also add some file appender. But this configuration with Chainsaw is great for online debuging or profilling cause I can filter on loggers and instantly see what is happening.

# re: Using Chainsaw Log Viewer with Log4Net 2/15/2006 10:14 AM Aaron
Thanks, been wondering how to get this horrible thing running.

# re: Using Chainsaw Log Viewer with Log4Net 5/18/2006 9:21 AM Pavol
For Aaron:
To run this thing, you first need to install Java Runtime on your computer and perhaps also Java Web Service. Just search for it on www.sun.com.
Then, clicking the Launch button on http://logging.apache.org/log4j/docs/chainsaw.html will download/compile/start the application. You can save a link to the app from your browser and store it e.g. on your Desktop.

# re: Using Chainsaw Log Viewer with Log4Net 5/18/2006 9:23 AM Pavol
Should have been "Java Virtual Machine" instead of "Java Runtime", sorry

# re: Using Chainsaw Log Viewer with Log4Net 7/16/2007 2:02 AM Statyk7
I’m currently working on a Chainsaw alternative, developped in C# 2.0, called Log2Console, with a simple but nice GUI. It’s still a beta version but it’s functional. Currently the available receivers are: Remoting, File and UDP.

The logger hierarchy is displayed in a tree view, and it’s possible to deactivate each of them. You can also filter according to the log level and the UI is customizable.

The project is hosted on CodePlex (a great service!!), the current release and the sources are available here: http://www.codeplex.com/log2console

You may want to give a try, your feedback is welcome!

# re: Using Chainsaw Log Viewer with Log4Net 8/2/2007 12:46 PM Brad
@Statyk7:

Your log2console is a nice tool! I'm locking forward to the final version..

I figured out that log4j:throwable tags are currently not handled. Could you implement this handling in the next beta release? :-)

Cheers, braD

# re: Using Chainsaw Log Viewer with Log4Net 7/9/2008 2:41 PM Henrik
"It requires Java. I know it sucks."

hee-he-he oh you .Net fanboy.

For some of us, the grass is green on both sides ;)

# re: Using Chainsaw Log Viewer with Log4Net 7/16/2009 3:56 AM Statyk7
A final version of Log2Console has been release a few months ago, it is quite stable and comes with some new features.

Check it out: http://log2console.codeplex.com/


# re: Using Chainsaw Log Viewer with Log4Net 1/18/2010 12:03 PM k
While overall a good first attempt, a number of usability issues, combined with the SocketAppender bug which essentially locks up the Sockets, thus causing both Chainsaw and the monitored Application (for examplke JBOSS) to stall causing many hours of frantic searching and debugging prevent this from being used in any capacity other than as a novelty.

# re: Using Chainsaw Log Viewer with Log4Net 1/19/2010 7:19 AM Praveen
How to open a existing Log4Net log fine in Log2Console application.

# re: Using Chainsaw Log Viewer with Log4Net 2/3/2010 11:09 AM Josef S.
Does anybody successfully launched the Log4net with Chainsaw over UDP on Windows 7 ??????


# re: Using Chainsaw Log Viewer with Log4Net 4/28/2010 1:48 AM Chris
"It requires Java. I know it sucks." - Without Java, ".Net" - Boy, you wouldn't even have log4net. In fact, you wouldn't even have C#.

# Discount 5/4/2010 2:43 PM Alex
Hey you all just check out the discount link, hops this will be benificial for you.

# re: Using Chainsaw Log Viewer with Log4Net 7/1/2010 8:43 AM olivier
If you're looking for a free open source LogViewer for Log4Net you can look at this one on CodePlex :
http://yourlog4netviewer.codeplex.com/


# re: Using Chainsaw Log Viewer with Log4Net 11/26/2010 8:30 PM baltimore payday loans Belair-Ed
I have to admit that I am so glad that I have found this your post because I have been searching for some information about the Chainsaw Log Viewer almost two hours. You helped me a lot indeed and reading this your article I have found many new and useful information about this subject. Well, I will definitely bookmark your website and wait for other useful and informative posts like this one in the future. Regards, Lenny.


Post A Comment
Title:
Name:
Email:
Comment:
Verification: