A: 

The one that comes in mind now is using interception (for example using Unity to intercept instances or types).

I've used this a while ago for trying to fail back to local data (cached from previous requests) when wcf services failed.

So I guess you could intercept calls to your DAL classes and try to log the information in the pre/post events of the pipeline.

For more info you can check this link.

Another approach could be to inject a logger class in your DAL classes (which hopefully have a base DAL class) by using an IoC container (Unity again, or MEF if you're in .NET 4.0).

If something else crosses my mind I`ll let you know.

Regards...

Padel
A: 

I'm currently working on an ASP.NET MVC application. This provides the ability to add custom filters to action methods. These are attribute classes inheriting from System.Web.Mvc.ActionFilterAttribute.

I simply decorate any action method I wish to log (or the controller class for all methods) with something like '[Log(LogLevel.High)]'. The LogAttribute class which provides this has a dependancy on my interface ILoggingProvider which contains a Write method (the concrete implementation logs to database). I handle the OnActionExecuted event in the LogAttribute class and use the eventargs to construct the data to pass to the Write method. If you wanted to log results too you could also log the OnResultExecuted event.

David Neale
A: 

I saw many examples that use "Triggers" to make sort of "History" for a table.

And they made Triggers for "Insert, Update and Delete" to just that tables that they want.

I consider that is very nice especially it doesn't need any interposing from my application.

But i still afraid from Triggers to effect performance !!!

So what is your Advice ??

Wahid Bitar