Posts

Showing posts with the label journal

An alternative auditing strategy for Grails apps

In some applications it is useful, and in some case required, that the application audits some or all database operations: for instance to track when a user updates, deletes or inserts a record. In Grails this is often handled by a plugin, like the Audit Logging plugin, which hooks into the Hibernate events and then logs the details to an audit table, including a timestamp, the user (if available) who initiated the operation and the type of operation. Unfortunately the Audit Logging plugin suffers from some issues  and if you, like me, have to ship today then you can only roll your own solution. In this post I will lay out a solution which is simple, efficient and should work in most scenarios. The general requirements are: only one datasource the underlying dbms must have triggers and some kind of session variables (most do, but I'll focus on Oracle) quartz jobs, background operations and other activities not necessarily initiated by an http request must properly initi...