audit

How To Create Generic SQL Server Stored Procedure To Perform Inserts Into Audit Table Based on Inserted and Deleted In Trigger

痴心易碎 提交于 2019-11-29 05:14:53
I have implemented an audit trail framework based on the information provided by the first answer to the following post: SQL Server history table - populate through SP or Trigger? Ultimately, the framework that I have implemented uses three triggers per table that insert audit information based on changes to the tables. My insert and delete audit triggers are fairly simple. However, the update triggers are far more complex because the trigger has to check to determine whether or not each column is under audit control and then perform an insert based on whether or not the column values in the

Implementing Audit Trail for Objects in C#?

走远了吗. 提交于 2019-11-29 03:27:56
问题 I'm looking for ideas on how to implement audit trails for my objects in C#, for the current project,basically I need to: 1.Store the old values and new values of a given object. 2.Record creation of new objects. 3.Deletion of old object. Is there any generic way of doing this,like using C# Generics,so that I don't have to write code for events of the base object like on creation,on deletion etc.(ORM objects).The thing is that if there was a way to inject audit trail if one is using a

Audit Logging Strategies

非 Y 不嫁゛ 提交于 2019-11-28 23:24:10
问题 I am trying to decide on the best method for audit logging within my application. The main reason for the log is reporting the sequence of events (changes). I have a hierarchy of Objects, I need to create reports when something changes on any part of that hierarchy, at a latter date. I think that I have three options: Have a log for each table and therefore matching the hierarchy of objects then creating a view for the report. Flatten the hierarchy and de-normalise the table, making reporting

History tables pros, cons and gotchas - using triggers, sproc or at application level [closed]

假如想象 提交于 2019-11-28 18:49:37
I am currently playing around with the idea of having history tables for some of my tables in my database. Basically I have the main table and a copy of that table with a modified date and an action column to store what action was preformed eg Update,Delete and Insert. So far I can think of three different places that you can do the history table work. Triggers on the main table for update, insert and delete. (Database) Stored procedures. (Database) Application layer. (Application) My main question is, what are the pros, cons and gotchas of doing the work in each of these layers. One advantage

Google Audit Question

三世轮回 提交于 2019-11-28 07:23:14
问题 The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript. 1 inline script block was found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource. My HTML is: <head> <link rel="Stylesheet" href="gStyle.css" /> <script type="text

SQL Server: Modifying the “Application Name” property for auditing purposes

ε祈祈猫儿з 提交于 2019-11-28 07:00:29
As we do not implement the users of our applications as users in SQL server, when the application server connects to a database each application always uses the same credentials to attach to each database. This presents an auditing problem. Using triggers, we want to store every update, insert and delete and attribute each to a particular user. One possible solution is to add an "updated by user" column to every table and update this every time. This means a new column on every table and a new parameter on every stored procedure. It also means you can only do soft deletes. Instead of this I

What false/true really mean for IPreInsertEventListeners?

拈花ヽ惹草 提交于 2019-11-28 05:22:34
问题 I recently have found out how to audit instances with the IPreDeleteEventListener , IPreInsertEventListener and IPreUpdateEventListener in the NHibernate.Event namespace. However, it still confuses me what shall these event return either on successful or unsuccessful finality. For example, let's take a look at Ayende's blog article found here: NHibernate IPreUpdateEventListener & IPreInsertEventListener Following his example, one could implement the interfaces as following: public class

See what process is using a file in Mac OS X

一世执手 提交于 2019-11-28 03:05:20
I would like to be able to track a file and see which process is touching that file. Is that possible? I know that I can see the list of open processes in activity monitor but I think it's happening to quickly for me to see it. The reason for this is I'm using a framework and I think the system version of the framework is being used instead of the debug version and I'd like to see which process is touching it. Shaun lsof will list open files, but it can be a bit awkward for momentary touches (eg, if the file isn't open when lsof runs, it doesn't show). I think your best bet would be

How to log application auditing to separate file on Wildfly 8

不问归期 提交于 2019-11-28 00:55:49
问题 I have a Java EE application running on Wildfly 8 in which I want to enable audit logging. Using an InterceptorBinding and Interceptor I am able to catch all relevant API calls. What I want to do is to write these audit calls to a separate audit log file. I tried implementing this using logback, and with the help of the second answer in this stackoverflow question I finally managed to do this. The first reply, i.e. disabling the system logging, did not work. However, while this solution

MySQL auto-store datetime for each row

北战南征 提交于 2019-11-27 17:42:05
In MySQL, I'm sick of adding the columns dt_created and dt_modified (which are date time stamps for creation and last modified respectively) to all the tables I have in my database. Every time I INSERT or UPDATE the database, I will have to use the NOW() keyword. This is going all over my persistence. Is there any efficient alternative where MySQL can automatically store at least the datatime of the row that is inserted and let me retrieve it? OMG Ponies You can use DEFAULT constraints to set the timestamp: ALTER TABLE MODIFY dt_created datetime DEFAULT CURRENT_TIMESTAMP ALTER TABLE MODIFY dt