views:

458

answers:

5

First of all - I've seen this question, but mine is a bit different.

What I need is some framework for logging debug information. This information will NOT be present in production environment. It will be used for tracking down performance problems and other generic bugs. Especially for performance problems, so it will be used a lot together with load testing.

Therefore I expect that the logs will have a lot of messages and going through them by hand to find the slow ones is NOT an option.

At first I thought of using the build in Trace facilities of ASP.NET. They even have this great tool which would be perfect for my needs. Unfortunately, it seems that the ASP.NET trace is fundamentally flawed and cannot be relied upon, especially under heavy load. :(

So now I need something else, and it should come with a good analysis tool. Anything you could recommend?

+1  A: 

Visual Studio Test Edition comes with a lot of what you're talking about. You could also look into using ANTS from RedGate to profile for performance bottlenecks.

If price is a barrier you'll probably want to go with log4net.

There are a couple parsers for log4net out there.

Echostorm
It's expensive. I don't think I'll get that tool. Besides - that's not what I wanted. I also want debugging logs.
Vilx-
Plus, it won't help with weird, hard to reproduce performance bugs. Ones that you have no alternative but to log for a longer period of time until you strike them.
Vilx-
Both products do generate pretty substantial reports and the test edition at least does a really good job of simulating traffic and different user behaviours. If price is a barrier you'll probably want to go with log4net
Echostorm
Simulating traffic is good, and we do use Visual Studio for that already. But there are some bugs which cannot be reproduced with stress tests. Some weird race conditions or what not else. I've seen this in other systems.
Vilx-
Sometimes we even have to leave these logs on at the production site to wait for the bug to occur, because we just can't reproduce it ourselves.
Vilx-
I understand. Log4Net or something like that is probably what you want then, it'll give you a bunch of different logging levels and ways to trace that data.
Echostorm
... and a viewing tool? I don't want to write my own log analyzer...
Vilx-
just posted a link and yes there are a few already
Echostorm
+1  A: 

Log4Net is a common logging framework used in FOSS projects.

Other good tools are using Enterprise Library logging and global exception handling (this is useful even in production environments to have.)

Chris Marisic
OK, but do they come with a nice log analyzer? I couldn't find anything.
Vilx-
The Enterprise Library ones will write to the Event Viewer, not a great analyzed but a basic one. I'm sure you could use 3rd party viewers instead.
Chris Marisic
Log analyzer? Try Chainsaw. http://logging.apache.org/chainsaw/index.html (chainsaw, it's for logs... cracks me up every time)
Hamish Smith
log4net us very good. however, look at these links for some gotchas to be aware of http://stackoverflow.com/questions/443795/log4net-works-in-main-thread-but-not-in-created-threadhttp://www.brianlow.com/index.php/2007/04/17/log4net-aspnet/
Hamish Smith
+1  A: 

I would recommend log4Net aswell, you can configure it to use several output types, so you can exactly configure how you like your logs to be created.

Tomh
Are there any available output types that come with a nice analyzer?
Vilx-
There are many, like http://www.codeproject.com/KB/cs/logviewer.aspx but a simple google query will help you find lots more.
Tomh
+2  A: 

I'd also recommend Log4net. You can configure it to output messages to log files, database, etc. If you're looking for a good viewer, you can set up the UdpAppender, and then use a tool like Chainsaw to read the log messages. It's Java based though, so if you really want to avoid it, you could also try Log4net Viewer.

For more information and details on how to set things up, check out Using Chainsaw with Log4net.

Mun
A: 

You might want to take a look at our logging tool SmartInspect, as it comes with a quite powerful log viewer with filtering capabilities among other things. It also includes example projects for ASP.NET.

Dennis G.
Looks nice. Pricey, but nice. I'll think about it. :)
Vilx-