8

Click here to load reader

Grails audit logging

Embed Size (px)

Citation preview

Page 1: Grails audit logging

Grails Audit LoggingBy:

Vishal Sahu

Page 2: Grails audit logging

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

Page 3: Grails audit logging

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.

Page 4: Grails audit logging

Installationdependencies {

compile 'org.grails.plugins:audit-logging:{version}'

}

Then:

grails compile

Page 5: Grails audit logging

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

Page 6: Grails audit logging

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

Page 7: Grails audit logging

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]

Page 8: Grails audit logging

Thanks.

Sample Application: https://github.com/NexThoughts/Grails-Audit-Logging-Example-Demo

For any queries you can reach me at:

[email protected]

https://github.com/Vishal-Sahu

https://github.com/Nexthoughts