Grails Audit Logging
By:
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 Logging
The 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.
Installation
dependencies {
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 class
Enables 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 Handlers
You 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:
vishal@nexthoughts.com
https://github.com/Vishal-Sahu
https://github.com/Nexthoughts

Grails audit logging

  • 1.
  • 2.
    What is AuditLog? 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
  • 3.
    Grails Audit Logging TheAudit 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.
  • 4.
  • 5.
    Create your DomainArtifact 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
  • 6.
    Auditing of domainclass Enables 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
  • 7.
    Event Handlers You mayuse 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]
  • 8.
    Thanks. Sample Application: https://github.com/NexThoughts/Grails-Audit-Logging-Example-Demo Forany queries you can reach me at: vishal@nexthoughts.com https://github.com/Vishal-Sahu https://github.com/Nexthoughts