This really is in regards to a simple yet efficient activity logging framework that I wish to integrate with my existing ASP.Internet based web-application (I have a LINQ-to-SQL based SQL DB as after sales). I am using something similar to something-architecture to do DB procedures - that's invoke relevant LINQ procedures. I have something class for nearly every entity (i.e. DB table) also it handles the CRUD procedures.

Generally, I have to track activities like - Mr.X added a brand new Item, My.Y looked about this filter, Mr.Z released caused by Power grid for an stand out document, etc... and other alike simple operation based logging (area-level logging is way for the time being)

So, this is what I have present in my 2 days of R&D around the SO, other forums and also the web:

Approach 1: Simple old method of using two tables: Activity (stores All of the activities together with its actor) &lifier ActivityType (lists kinds of activities). I have something layer so either I may have a "ServieBase" class which taps All of the CRUD occasions and logs the main one by which I am interested. Things are handled from inside the code.


Approach 2: Use database TRIGGERs to tap occasions at table level after which perform logging. This is completely 'abstract' towards the application. I have "LastModifiedBy" area in every table so I'll obtain the 'actor' data and that i can perform the logging but this may limit me to DB-procedures &lifier need me to trace other application-activities individually. but when its worth I'm able to contemplate it.

Approach 3: (conceptual, require more guidance)

3.1 MVC approach - We are considering implementing MVC later on and I have found some efficient logging methods in MVC like - (is ther anything like this for traditional L2S based web-application?)

3.2 Monitoring Services I discovered a 'tracking service' feature in home windows - can there be its web-equivalent?

3.3 Misc - Another options that we discovered try not to appear too convincing or I'd better say they work although not mine :-)

Ref -

SQL Profiler:

So, what say? Any suggestions and new ideas are welcome. For the time being, it appears I'd land approximately the very first-two approaches because we would like it to be simple later on to have the ability to add any other activity to become drenched.


Here's another item to increase your toolkit: Sql Server Change Tracking. However it will not fit everything in you are searching for here. You may have a look in the Command pattern. I'd create an interface, ITrackedCommand, after which implement individuals because the instructions the user are capable of doing. Then, each is performed via a command dispatcher which instantly calls ITrackedCommand.Log. I believe which will enable you to get where you have to go.