ASP.NET .NET Application Monitoring

I have a number of applications running on top of ASP.NET that I want to track. The main thing I care about is:

  • Exceptions Currently, we have created a special code that will send us an email when an exception occurs. If the application fails, it will violate our worldview ... I know (and use) elmah, which partially solves the problem, but it is still just a large exception table with a nice (ish) interface. I want something that makes sense about all these exceptions (for example, group exceptions, warnings when new ones appear, tell me which common ones I should fix, etc.)

  • Logging: we are currently logging files that are then accessible through a shared folder in which dev grep and tail. Does anyone know of better ways to present this information. In an ideal world, I want to associate it with exceptions.

  • Performance: query time, memory usage, processor, etc. any statistics i can get

I suppose this is likely to be decided by a number of tools, does anyone have any suggestions?

+7
source share
8 answers

You should take a look at Gibraltar not to use it yourself, but it looks very good! Also works with nLog and log4net, so if you use them, you're in luck !!

+3
source

Well, we have exactly the same current solution. Emails clutter up my inbox and are mostly ignored. During the holidays, the error made everyone in dev hit the limit of incoming messages;)

So where do we head the decision?

  • We already generate classes for all of our excrement, they are rarely used from more than one place. This was essentially the first step, but we started the code base this way.
  • We modified the generator to create unique HRESULT values ​​for all exceptions.
  • Again, we added a generator to create a .MC message resource file for each exception.
  • Now every exception can be written to the Windows event log, and therefore we delete all emails, etc. and rely on the event log.
  • Now that the event log contains all the information, including unique message codes and parameters for each exception, we can use ready-made tools for aggregation, monitoring and notification.

The exception generator (before the changes above) is here:

It integrates with visual studio, replacing the ResX generator with the following:

I have not published the MC generator or the HRESULT generation yet; however, it will be available in the above locations when I get the time.

- UPDATE -

Now all tools and sources are available for online. So where do I go?

  • Download the source or binaries from: http://code.google.com/p/csharptest-net/
  • Take a look at the help CmdTool.exe Integration with Visual Studio
  • Then, look at the Help Generators for ResX and MC files , there are several ways to generate MC files or complete DLL messages from ResX files. Choose the approach that best suits you.
  • Run CmdTool.exe REGISTER to register the tool using Visual Studio
  • Create the ResX file as usual, then change the custom tool to CmdTool
  • You will need to add some entries to the resx file. At a minimum, create the following:
  • Now you must create an exception class that writes log events. You will need to create the MC file as a pre / post build action with something like:
    • CSharpTest.Net.Generators.exe RESXTOMESSAGEDLL /output=MyCustomMessages.dll /input=TheProjectWithAResX.csproj
  • Finally, you need to register it, run the InstallUtil.exe MyCustomMessages.dll framework InstallUtil.exe MyCustomMessages.dll

This should start until I get the time to document everything.

+3
source

In terms of handled exceptions or just typical logging, l4ndash is worth a look. I always installed log4net not only for writing out text files, but also for adding to the database. This way l4ndash can easily analyze it. It will group your mistakes, let you see where bad things happen a lot. You get a free free license

With Elmah we just take magazines. It can export as csv, then we use Excel to filter / group the data. It is not perfect, but it works. It would be nice to write a script to automate this a bit more. I have not seen more than others there for Elma.

+1
source

One suggestion from Ryans Roberts I really like the exceptioneer , which apparently solves my problems with exceptions.

+1
source

First I would go to log4net . SmtpAppender can wait for N exceptions to accumulate before sending an email and avoiding Outlook crashes. And log4net also logs log files that can be stored on network drives, read with cat and grep, etc.

About statistics, you can keep a log of health / performance using the same tools, i.e. create a thread that records CPU usage every minute, etc.

I do not have a specific answer for the first part of the question, since it involves automatic analysis of the journal and coalescence . At the university, we created a tool that is designed to partially implement these things, but does not apply to your scenario (but it is two-way integrated with log4net).

+1
source

You can get some query time metrics (and everything else that was saved) by running LogParser in IIS logs.

0
source

We created a simple monitoring application, which is located on the desktop and flashes red when one of the applications on the server has either an exception recorded in the event log, or it writes an error to the error log table in the database. It also monitors database status, fragmentation checks, etc.

The only problem we are dealing with is that it can be a little annoying on the desktop as it continues to appear with a red message box if there is a problem. However, this prompts you to fix it as soon as possible.

We are currently working on several development machines. We want to improve one monitoring application on the server, which then publishes the rss channel, so that the application only checks once in one place, but we can use information from anywhere using the method that we select at that time (for example, through our phones when we are not in the office).

0
source

You can select an RSS feed from the Exclusions table (and other things). Then you can subscribe to the RSS feed in MS Outlook or on any smartphone. I use an RSS feed reader called NewsRob because it warns me when there is something new.

I will talk about how to do it HERE.

As a related step, I found a way to notify myself when something did not happen. This blog is HERE.

0
source

All Articles