Click here to load reader
Upload
nexthoughts-technologies
View
148
Download
3
Embed Size (px)
Citation preview
Grails Audit LoggingBy:
Vishal Sahu
What is Audit Log?An Audit log is a security-relevant chronological record, set of records, and/or destination and source of records that provide documentary evidence of the sequence of activities that have affected at any time a specific operation, procedure, or event.
Industries using Audit Logging:
● TeleCommunications● Information Security● Accounting● Clinical Research● Nursing Research
Grails Audit LoggingThe Audit Logging plugin adds Grails GORM Events based Audit Logging capabilities to a Grails project and it also adds support to domain models for hooking into the Grails GORM events system.
Installationdependencies {
compile 'org.grails.plugins:audit-logging:{version}'
}
Then:
grails compile
Create your Domain Artifact After installing the plugin, you must perform the following command to let the plugin create the audit-logging domain class within your project.
● grails audit-quickstart com.audit AuditTrail
Auditing of domain classEnables audit logging using the introduced domain class AuditLogEvent which will record insert, update, and delete events. Update events will be logged in detail with the property name and the old and new values.
● static auditable = true
Event HandlersYou may use the optional event handlers in your Domain classes. Example:
● onSave● onDelete● onChange
If you want to use Events Handlers only, then you can use:
static auditable = [handlersOnly : true]
Thanks.
Sample Application: https://github.com/NexThoughts/Grails-Audit-Logging-Example-Demo
For any queries you can reach me at:
https://github.com/Vishal-Sahu
https://github.com/Nexthoughts