0

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?

Community
  • 1
  • 1
Vilx-
  • 104,512
  • 87
  • 279
  • 422

5 Answers5

2

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
  • 32,487
  • 24
  • 164
  • 258
  • OK, but do they come with a nice log analyzer? I couldn't find anything. – Vilx- Feb 11 '09 at 15:49
  • 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 Feb 11 '09 at 16:02
  • Log analyzer? Try Chainsaw. http://logging.apache.org/chainsaw/index.html (chainsaw, it's for logs... cracks me up every time) – Hamish Smith Feb 11 '09 at 19:40
  • 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-thread http://www.brianlow.com/index.php/2007/04/17/log4net-aspnet/ – Hamish Smith Feb 11 '09 at 19:42
2

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.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Mun
  • 14,098
  • 11
  • 59
  • 83
1

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
  • 9,678
  • 8
  • 36
  • 50
  • 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- Feb 11 '09 at 15:38
  • 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- Feb 11 '09 at 15:44
  • 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 Feb 11 '09 at 15:46
  • 1
    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- Feb 11 '09 at 15:47
  • 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- Feb 11 '09 at 15:48
  • 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 Feb 11 '09 at 15:49
  • ... and a viewing tool? I don't want to write my own log analyzer... – Vilx- Feb 11 '09 at 15:51
  • just posted a link and yes there are a few already – Echostorm Feb 11 '09 at 15:51
1

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.

TomHastjarjanto
  • 5,386
  • 1
  • 29
  • 41
0

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.
  • 2,277
  • 2
  • 19
  • 25