Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Audit Trail and Entity Framework

Audit Trail and Entity Framework

Scheduled Pinned Locked Moved Database
databasequestioncsharpsysadmindebugging
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andreas schaerer
    wrote on last edited by
    #1

    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

    M D S 3 Replies Last reply
    0
    • A andreas schaerer

      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

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • A andreas schaerer

        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

        D Offline
        D Offline
        David Skelly
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • A andreas schaerer

          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

          S Offline
          S Offline
          scottgp
          wrote on last edited by
          #4

          I'm not sure what level of detail you're looking for in your auditing, but have you checked out what's built in to SQL Server 2008 - http://msdn.microsoft.com/en-us/library/dd392015.aspx[^]? Scott

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups