Question

I have a bunch of existing client/server applications that are currently chugging along. Once in a while, a client will want to add on some type of web-interface to access part of their data. These are typically custom, although some are "generic"; but everyone has their own "instance" in its own VM.

What I want is a centralized area to capture and log any errors that come up on any of these VMs.

I'm consitering creating a new database and setting up a WCF Service to enable each of these webapps to create a log entry in my centralized database as well as to the local EventLog.

Is that a bad design?

update

The webapps are on 2003/IIS6 and 2008/IIS7, built in ASP.NET. Many of the instances are on a pair of web servers, but many will be deployed to individual VMs.

Was it helpful?

Solution

This is exactly how we implemented it.

We have 3 tables in the database:

Event Types
------------ 
EventType int 
EventDescription varchar(50)


MonitoredSystems
---------------
SystemID int
SystemName varchar(50)
SystemDescription text


Events
-------
RecordID bigint
EventTime datetime
SystemID int FK
EventText text
EventType int FK
Acknowledged bit

We also whipped up a site where we could view the events. The "Acknowledged" field let us set up a view names "Unacknowledged critical issues" so that we can quickly see any new issues, and acknowledge them as we read them.

We know there are other tools out there that can do this for us, but none was as easy to integrate as our own home grown version, and we now use it in every app we build. We have some other customizations that I am not mentioning here that other tools didn't provide out of the box.

So I think your idea is fine. If you build it yourself, you can customize it to work the way you want. However, I would recommend at least looking into tools such as Log4net, etc.

OTHER TIPS

You should take a look at ELMAH (error logging modules and handlers) (http://code.google.com/p/elmah/) with the combination of Orbit One's Exception Reporter (http://aspexceptionreporter.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35343) which when combined can give you enterprise wide coverage for error reporting in a centralized location.

If you log frequently (debug/info/warning), make sure that you RPC-invokations are done asynchronously.

I'd recommend a more flexible data structure;

Events
-------
RecordID bigint
EventTime datetime
EventLevel text 
SystemID text
EventText text
EventType text
Acknowledged bit

EventProperties
-------
RecordID bigint
key text
value text

The EventProperties allows the logging application to log any information that might be useful, without having to define such properties ahead of time. Note that there are no constraints on SystemID, which allows the addition of systems without configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top