Audit Trail and Entity Framework
-
Hy, im evaluating how to implement Audit trail in a multi-tier .NET 3.5 Database driven Webapplication based on nettiers and SQL-Server 2008. I read a lot about the subject, but im still not sure whats the easiest way to do it. Is it possible at all to implement it (without refactoring everything) with the entity framework if the rest of the application never used the EF? Or do you guys think, that triggers would do the job just fine? Ah, and a 2nd question: Do I get this right, that frameworks like log4net are just for logging debug-infos and not for audittrail? thanx a lot for any input! Andreas
-
Hy, im evaluating how to implement Audit trail in a multi-tier .NET 3.5 Database driven Webapplication based on nettiers and SQL-Server 2008. I read a lot about the subject, but im still not sure whats the easiest way to do it. Is it possible at all to implement it (without refactoring everything) with the entity framework if the rest of the application never used the EF? Or do you guys think, that triggers would do the job just fine? Ah, and a 2nd question: Do I get this right, that frameworks like log4net are just for logging debug-infos and not for audittrail? thanx a lot for any input! Andreas
andreas.schaerer wrote:
that triggers would do the job just fine
Sorry, stopped reading at this point. Anyone who has positive thoughts about triggers needs to be taken out and boiled in oil, shot, drawn and quartered and then made to support the abomination they have created. I hate triggers. I know they are the "recommended" solution to this problem but I still hate em. I have also never had to implement a really stringent auditing solution. You also need to define the level of auditing you need to do. We usually settle for a log of who changed the record and when, tracking from and to data is whole nother level of nasties.
Never underestimate the power of human stupidity RAH
-
Hy, im evaluating how to implement Audit trail in a multi-tier .NET 3.5 Database driven Webapplication based on nettiers and SQL-Server 2008. I read a lot about the subject, but im still not sure whats the easiest way to do it. Is it possible at all to implement it (without refactoring everything) with the entity framework if the rest of the application never used the EF? Or do you guys think, that triggers would do the job just fine? Ah, and a 2nd question: Do I get this right, that frameworks like log4net are just for logging debug-infos and not for audittrail? thanx a lot for any input! Andreas
I worked on a system that had some quite strict auditing requirements and the way we managed it was to lock down the tables in the database so that only DBAs had direct update access to the tables. Any updates to the tables by anyone else had to be via stored procedures. Built in to every stored proc was a bit of code that wrote out the audit history of what was happening (which table, which columns, old data, new data, date and time, user id, etc.). But it sounds as if you want to keep the impact on your existing system to a minimum, in which case you may end up having to use triggers as the least painful option. As for log4net, it is a generic logging system that can log pretty much anything you want it to log about the behaviour of your system. You can use it to log debug info, you can also use it to log error conditions for later investigation, you can also use it to log configuration information at system start up, anything you want. I suppose you could use it as part of an audit system in your application, depending on what your requirements were and how strict it needed to be.
-
Hy, im evaluating how to implement Audit trail in a multi-tier .NET 3.5 Database driven Webapplication based on nettiers and SQL-Server 2008. I read a lot about the subject, but im still not sure whats the easiest way to do it. Is it possible at all to implement it (without refactoring everything) with the entity framework if the rest of the application never used the EF? Or do you guys think, that triggers would do the job just fine? Ah, and a 2nd question: Do I get this right, that frameworks like log4net are just for logging debug-infos and not for audittrail? thanx a lot for any input! Andreas