I will log every user-action on the database using the logged in person's user name in my ASP.NET application Identifier in the log
What is the easiest way to do this?
I think for every method call, to call my data access layer, I have to log the parameters of that call and call the user name and then a new "log event" method Which writes the details of the call in the table.
Am I on the right track? <3:> Use the trigger, use the SQL to log in with your put, or use log4net to log in with your put.
If you are using triggers, add the end user column to each table and say the required column (i.e. Do not tap with check barrier that it is not empty string). You will need the LastUser column available for the code in your trigger so that you can record who was doing what. You do not say that which database system you are using; Some do not support triggers or do not support selection triggers (do you need to record to run the selection statement?).
Log in to DAL using Siek
If you are logging in to the database with your DAL, then hopefully all your call codes Let's go through some central pieces. If so, you can add your single logging method to that section of that code. Remember that you want to wrap all calls in the form of databases in a transaction so that your logs and actual data are not out of sync.
Log4Net Use
You can easily set up log4net to record all data access. Log4net has the ability to record entry entries in log files, but also in the database. Adding Log 4 Net to the existing code is easy, and the configuration is relatively easy.
Comments
Post a Comment