Git Product home page Git Product logo

grails-audit-logging-plugin's People

Contributors

alanwilkie-finocomp avatar aldrinm avatar burtbeckwith avatar dmahapatro avatar dpcasady avatar fcambarieri avatar felixscheinost avatar graemerocher avatar jnunderwood avatar jpalmer1026 avatar longwa avatar marquisdemizzle avatar mattlong-finocomp avatar mattmoss avatar mb0rn avatar robertoschwald avatar satamas avatar smakela avatar tcrossland avatar tkvw avatar xqliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grails-audit-logging-plugin's Issues

GPAUDITLOGGING-50: Log old collection values

Original Reporter: roos
Environment: Not Specified
Version: Grails-AuditLogging 1.0.0
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-50

With 1.0.0, we will be ORM implementation agnostic and will not depend on Hibernate anymore.

GrailsDomainClass currently does not support getting old value for collections as Hibernate supports with snapshots (which we used in the 0.5.x plugin versions).

We need to find a way to get the old value of collections.

GPAUDITLOGGING-29: Support UUID with Grails Audit Logging Plugin

Original Reporter: giancarlo.angulo
Environment: Not Specified
Version: Grails-Spring-Security-CAS 0.1
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-29

When using uuid as default generator of id:
static mapping = {
id generator:'uuid'
}

the audit logging plugin fails due to a type mismatch exception.

It would be nice if we could set id in grails plugin to use uuid by setting something in the grails config file.

I've a attached a file one of my co-worker did but it basically added a the line above and

String id

in the domain class of AuditLogEvent.

GPAUDITLOGGING-1: Ignore list not considered in case of insert and delete

Original Reporter: siddharthoak
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-1

The onPreDelete and onPostInsert invoke the makeMap() method to populate the map that contains the data that is persisted in the Augit_Log table.

The significantChange() method which is invoked when an UPDATE occurs; removes the items from the map that are mentioned in the ignoreList. But, the method - makeMap() does not take into consideration the ignoreList and adds all the properties of an auditable object.

GPAUDITLOGGING-40: Audit logging does not log propperly when using Domain Mixins

Original Reporter: roos
Environment: Not Specified
Version: Grails-AuditLogging 0.5.4
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-40

When using DomainMixins, currently the plugin logs relations as "mixin.@xxx" due to bug http://jira.codehaus.org/browse/GROOVY-3236

To workaround this, the mixin developer can add the toString() method to the Mixin with this:
{code}
def toString(){
this as String
}
{code}

As Grails developers not always have access to all Domain Mixin classes, best would be to change AuditLogListener.truncate to:

{code}
String truncate(final obj, int max) {
log.trace "trimming object's string representation based on ${max} characters."
def str = "$obj".trim() // change due to GROOVY-3236
return (str?.length() > max) ? str?.substring(0, max) : str
}
{code}

GPAUDITLOGGING-27: ability to identify transient properties to avoid auditing

Original Reporter: mgkimsal
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-27

I've got some domain methods that seem to be introducing a new property in to the mix, but aren't part of the domain.

class student {
String fname
String lname

def getName() {
fname + " " + lname
}

}

when audit logging, it's trying to do an audit on a 'name' property, which doesn't seem to be right, imo.

Having a property in the class (or some setting somewhere) with a list of properties to skip would help avoid this issue.

GPAUDITLOGGING-9: audit-logging breaks deletes in grails 1.3.X (grails hibernate-plugin 1.3X)

Original Reporter: cummingscs
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-9

Background: http://grails.1312388.n4.nabble.com/audit-logging-causing-problems-with-deletes-in-grails-1-3-X-td2225195.html#a2225195

In Grails 1.3 and 1.3.1, audible domain classes fail to be deleted, yet there is no error or stacktrace indicating that something went wrong. Here [1] is code that demonstrates the issue in a project with audit-logging-0.5.2 plugin installed.

[1] http://grails-user.pastebin.com/X5dwdwj9

GPAUDITLOGGING-49: potential NPE in AuditLogListener when trying to create unmodifiable list with null snapshot

Original Reporter: sp
Environment: Grails 2.3.4
Version: Grails-AuditLogging 0.5.5.3
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-49

In the below code oldMap[keyName] = Collections.unmodifiableList((List) snapshot); will throw an exception in the case when the snapshot is null

{code}
private populateOldStateMap(def oldState, Map oldMap, String keyName, int index) {
def oldPropertyState = oldState[index]
if (oldPropertyState instanceof PersistentCollection) {
PersistentCollection pc = (PersistentCollection) oldPropertyState;
PersistenceContext context = sessionFactory.getCurrentSession().getPersistenceContext();
CollectionEntry entry = context.getCollectionEntry(pc);
Object snapshot = entry.getSnapshot();
if (pc instanceof List) {
oldMap[keyName] = Collections.unmodifiableList((List) snapshot);
} else if (pc instanceof Map) {
oldMap[keyName] = Collections.unmodifiableMap((Map) snapshot);
} else if (pc instanceof Set) {
//Set snapshot is actually stored as a Map
if (snapshot) {
Map snapshotMap = (Map) snapshot;
oldMap[keyName] = Collections.unmodifiableSet(new HashSet(snapshotMap?.values()));
log.trace(oldMap[keyName].class);
} else {
log.trace("Cannot get snapshot of $pc Entry: $entry for keyName: $keyName");
oldMap[keyName] = null
}
} else {
oldMap[keyName] = pc;
}
} else {
oldMap[keyName] = oldPropertyState
}
}

{code}

GPAUDITLOGGING-21: Provide configuration to change the default length of stored value in audit log

Original Reporter: wenca
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-21

By default the stored length of the new and old value is only 255 and if I want to store any longer data it is not possible to configure it.
Just provide one config var that will be used by the truncate method of AuditLogInterceptor and by AuditLogEvent mapping. Thanks.

GPAUDITLOGGING-3: Sometimes unchanged values are logged as changed

Original Reporter: mlk
Environment: MySQL
Version: Grails-AuditLogging 0.5.3
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-3

In our product we have encountered values being logged as changed even though they are not.
In other words oldValue==newValue for a lot of rows in the auditlog table.

The problem is that sometimes, when it compares the old value with a new value, it ends up comparing a value of class HibernateProxy to a value of class String.

We have fixed this by modifying AuditLogListener.groovy.
We have added the method:

{code:java}
def retrieveNonProxyValueIfApplicable(value) {
def v = value
if( v instanceof HibernateProxy ) {
v = ((HibernateProxy)v).getHibernateLazyInitializer().getImplementation();
}
return v
}
{code}

and changed these lines in the onChange method:

{code:java}
if(oldState) oldMap[nameMap[ii]] = oldState[ii]
if(newState) newMap[nameMap[ii]] = newState[ii]
{code}

to:
{code:java}
if(oldState) oldMap[nameMap[ii]] = retrieveNonProxyValueIfApplicable(oldState[ii])
if(newState) newMap[nameMap[ii]] = retrieveNonProxyValueIfApplicable(newState[ii])
{code}

Hope this helps others confronted with the same issue.

/Morten

GPAUDITLOGGING-35: Allow global audit logging setting

Original Reporter: eceres
Environment: Not Specified
Version: Grails-AuditLogging 0.5.4
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-35

Currently each gorm object needs to have the auditable value set. Would be easier and more consistent to set a global default auditable state in Config.groovy that gets applied to all objects. This is helpful if you can not modify all gorm objects but want universal logging, have a lot of gorm objects to modify, or want to ensure future compliance. Each gorm object can over-ride the default behavior to change/turn it off the same as current configuration for audit logging.

The provided patch is consistent with the current behavior if Config.groovy does not get added defaults. Then modifying Config.groovy will allow setting the 4 main settings of audit logging via different parameters.

Example of new Config.groovy settings allowed from this patch:

auditLog {
auditableDefault = true
handlersOnlyDefault = true
ignoreDefault = ['version','lastUpdated','ignoreMe']
defaultHandlerClosure = { request, session, handler, entity, oldMap, newMap ->
print "Handler called for ${entity.class.toString()} object due to change of ${handler}"
}
}

auditableDefault - can be true or false. If false (standard behavior) will only log for classes with static auditable defined. If true then will log for any class that does not set static auditable = false.

handlersOnlyDefault - can be true or false. If false (standard behavior) will continue to log as normal. If true will not carry out the logging except on any class with static auditable = [handlersOnly:false]

ignoreDefault - takes a list that will be the default fields ignored. If not provided will be ['version', 'lastUpdated'] like the current version. Like other properties setting ignore: in the static auditable will use that over the default.

defaultHandlerClosure - A closure that will be called if the gorm object does not have the proper on method (onChange, onSave, onDelete). The closure takes 5 parameters as shown in above example. The handler value will be a string equal to the on method that was not provided.

Gorm built-in "version" field is dealt with inconsistently

While there is a spot in the AuditLogEvent object for the persisted object's version, it is dealt with inconsistently and does not behave as expected.

With the default configuration, the only event that captures the persisted object version is the DELETE event. The rest of the events seem to discard the version for various reasons. (ie. special handling in the logChanges() code, significantChange() stripping "ignored" fields, default ignored field list including it)

It would be best if this was dealt with in a consistent way, and ideally to always include the persisted object version, since that identifies the object version that was changing. To put it another way, the object ID + version is the "change group identifier" to tell what fields all changed at once.

GPAUDITLOGGING-48: Make plugin ORM implementation agnostic

GPAUDITLOGGING-38: audit-logging breaks deletes in grails 2.0.X

Original Reporter: [email protected]
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-38

In Grails 2.0.3, audible domain classes fail to be deleted, yet there is no error or stacktrace indicating that something went wrong. I am using audit logging plugin 0.5.4.

In my domain I have hasMany relation ship.Delete events got auditing in the AUDIT_LOG table but deletion of that object is failing with NPE.

GPAUDITLOGGING-6: beforeDelete, afterInsert, afterUpdate GORM event handlers not firing

Original Reporter: jbarmash
Environment: Plugin Version 0.5.2, Grails 1.2.2
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-6

It looks like the plugin tries to add the PreDeleteEventListerer and others without affecting other listeners, but the events don't fire.

I put in a simple workaround to check for it, here is an example for AuditLogListener.onPostInsert() - put this towards the end of the method after audit logging has executed.

 if (entity.metaClass.respondsTo(entity, 'afterInsert')) {
     log.error "afterInsert exists on domain Class ${event.getEntity().getClass().getName()}.  Calling it" 
    entity.afterInsert()
  }

GPAUDITLOGGING-12: Audit logging does not work properly for domain object having collection(of other domain objects)

Original Reporter: ashishj01
Environment: PreProduction
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-12

Domain class that has a collection of another domain object doesn not log correctly.
Let me try to explain the scenario :

* I have a class Group(in the domain folder) marked as auditable(set to true).
* The groups class hasMany accounts (i.e has a field as static hasMany =[accounts : Account])
* Account is another domain object and is auditable as well.
* Set up some dummy data for Group with name say, GroupA with 3 accounts added to the accounts collection, say Acnt1, Acnt2 and Acnt3.
* Now, change or update the Group class to remove accounts one by one, each in seperate transactions and oberserve the inconsitency in the audit logging.

* When Acnt3 is updated or removed, its is logged properly by the plugin
  value of oldMap=[] newMap=[Acnt1, Acnt2]
* When Acnt2 is updated or removed, its is logged properly by the plugin
  value of oldMap=[] newMap=[Acnt1]
* When Acnt1 is updated or removed, its is NOT logged properly by the plugin
  In this case, the onChange call back in not invoked because, there is some piece of code in the plugin that tries to act smart and decides to do nothing if oldMap and newMap is same.

Firstly, why is the value of oldMap set to [] in all cases. Shouldnt the default behaviour have the values in the collection set in oldMap. Is there anything special I need to do in my code to set the oldMap to correct values?

This is a show stopper for us and needs to be addressed urgently. If you know the fix , can you send the details so that we can edit the plugin at our end and use it.

GPAUDITLOGGING-8: Can not log collection change

Original Reporter: jmeam
Environment: Grails 1.3.2
Version: Grails-AuditLogging 0.5.3
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-8

When object's collection properties change (ie. in many-to-many relation). Hibernate return new collection in getOldState(). Thus make plugin does not know that the collection was changed and not log the change.

Solution was to get a snapshot.
http://stackoverflow.com/questions/812364

I've attached a modified AuditLogListener.groovy file (v 0.5.3) according to above post.

PS. the file include other modification to change java.util.Date to java.sql.Timestamp for consistency

GPAUDITLOGGING-10: Audit-Logging plugin list.gsp "home" link doesn't point to the project index.gsp

Original Reporter: mfk0213
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-10

The Audit-Logging plugin's gsps do not point to the home of the project for the "home" links.

I installed and configured Acegi, then installed the Audit-Logging plugin, which works perfectly in capturing audit data. When I go to the audit logging controller list view, the home button points to $project_home/plugins/audit-logging-0.5 instead of $project_home/index.gsp

GPAUDITLOGGING-22: Making verbose configurable per domain object - Allowing to choose what events to audit per domain obj - Issue/conflict with Shiro plugin when retrieving URI to store in the audit table

Original Reporter: amalbet
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-22

I would like to propose these enhancements for next release:

  • Making verbose configurable per domain object
  • Allowing to choose what events to audit per domain obj
  • Issue/conflict with Shiro plugin when retrieving URI to store in the audit table

GPAUDITLOGGING-14: AuditLogEvent domain object fails to save on PostgreSQL and Oracle databases

Original Reporter: mjhugo
Environment: PostgreSQL and Oracle
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-14

Attached is a patch that provides a workaround for problems discussed on the Grails mailing list http://www.nabble.com/Audit-Logging-Plugin-Question-td17430121.html and http://www.nabble.com/how-do-I-encrypt-a-password—td17130128.html#a17170904 with the Audit Log plugin. The plugin successfully creates rows in the Audit Log table when using the in memory database, but fails silently with at least two ‘real’ databases (postgres and oracle).

Please note that this particular patch will only work with a postgres database. In particular, the SQL statement used in AuditLogListener.saveAuditLog() uses
1) select nextval (‘hibernate_sequence’) and
2) now()
which may or may not work depending on your database.

I don’t think this is the ideal solution, but it may help some people get past the initial issue until a more permanent solution is found.

GPAUDITLOGGING-2: Audit logging does not work properly for domain object having collection(of other domain objects)

Original Reporter: ashishj01
Environment: PreProduction
Version: Grails-AuditLogging 0.5.4
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-2

Domain class that has a collection of another domain object doesn not log correctly.
Let me try to explain the scenario :

  • I have a class Group(in the domain folder) marked as auditable(set to true).
  • The groups class hasMany accounts (i.e has a field as static hasMany =[accounts : Account])
  • Account is another domain object and is auditable as well.
  • Set up some dummy data for Group with name say, GroupA with 3 accounts added to the accounts collection, say Acnt1, Acnt2 and Acnt3.
  • Now, change or update the Group class to remove accounts one by one, each in seperate transactions and oberserve the inconsitency in the audit logging.
    • When Acnt3 is updated or removed, its is logged properly by the plugin
      value of oldMap=[] newMap=[Acnt1, Acnt2]
    • When Acnt2 is updated or removed, its is logged properly by the plugin
      value of oldMap=[] newMap=[Acnt1]
    • When Acnt1 is updated or removed, its is NOT logged properly by the plugin
      In this case, the onChange call back in not invoked because, there is some piece of code in the plugin that tries to act smart and decides to do nothing if oldMap and newMap is same.

Firstly, why is the value of oldMap set to [] in all cases. Shouldnt the default behaviour have the values in the collection set in oldMap. Is there anything special I need to do in my code to set the oldMap to correct values?

This is a show stopper for us and needs to be addressed urgently. If you know the fix , can you send the details so that we can edit the plugin at our end and use it.

GPAUDITLOGGING-19: A dynamic finder method for Auditable classes that allows a developer to query a given object's history from the audit log

Original Reporter: hartsock
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-19

From this thread:
[Audit Logging Association|http://grails.1312388.n4.nabble.com/Audit-Logging-Association-tp1564763p1564958.html]

here's what I had to do to make this work.

  1. Add "import org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent" to the Person domain class.
  2. Add the following code to the Person domain class to specify the getChanges method:
    List getChanges() {
    AuditLogEvent.findAllByClassNameAndPersistedObjectId(this.getClass().getName(),this.id)
    }
  3. I then added something like this to my controller...
    def show = {
    def personInstance = Person.get(params.id)
    def personChanges = personInstance.getChanges()
    return [personInstance:personInstance,personChanges:personChanges]
    }

GPAUDITLOGGING-15: Integration tests with auditable domain class do not observe test transaction boundary

Original Reporter: mecameron
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-15

Creating a simple domain class with one string field that must be unique fails to observe the transaction boundary of tests if the domain class is marked as auditable.

This worked in Grails 1.2.0, but broke when I tried to upgrade to 1.3.2.

The domain class is simply:
{code}
class User {

String name

static auditable = true

static constraints = {
    name(unique:true)
}

}
{code}

And test:
{code}
void testUser1() {
def user = new User( name: 'UniqueName' )
user.save(failOnError:true)
}

void testUser2() {
    def user = new User( name: 'UniqueName' )
    user.save(failOnError:true)
}

{code}

I've added testable code for Grails 1.3.2 and 1.2.0

GPAUDITLOGGING-34: org.hibernate.cache.NoCachingEnabledException when using with mySql

Original Reporter: martinstephenson
Environment: WIndows 7, SpringSource 2.7.1, Grails 1.3.7, mySQL 5.5.8
Version: Grails-AuditLogging 0.5.4
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-34

I am trying to use the Audit Loggin plugin but cannot get it to run with mySql - If I switch back to the default hsqldb in DataSource.groovy I do not get the error

Error is :

Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\Program Files\springsource\grails-1.3.7\

Base Directory: C:\Development\Springsource\AuditLogTest
Resolving dependencies...
Dependencies resolved in 1042ms.
Running script C:\Program Files\springsource\grails-1.3.7\scripts\RunApp.groovy
Environment set to development
[groovyc] Compiling 2 source files to C:\Development\Springsource\AuditLogTest\target\classes
[delete] Deleting directory C:\Users\Martin Stephenson.grails\1.3.7\projects\AuditLogTest\tomcat
Running Grails application..
2011-09-12 20:05:47,405 [main] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp:33)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
... 23 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
... 23 more
Caused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
... 23 more

DataSource.groovy is :

dataSource {
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
username = "root"
password = ""

hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "update" // one of 'create', 'create-drop','update'
url = "jdbc:mysql://127.0.0.1:3306/AUDIT_DEV"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://127.0.0.1:3306/AUDIT_TEST"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://127.0.0.1:3306/AUDIT_PROD"
}
}
}
}

GPAUDITLOGGING-20: Generate human readable change colum

Original Reporter: wal5hy
Environment: Not Specified
Version: Grails-AuditLogging 0.5.4
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-20

Would be really great to be able to use the audit plugin to generate human readable change description column in the audit table. For example:

"Joe blogs updated product TG-238 by changing number of legs from 3 to 4"

in pseudo-pseudocode:

"${actor} updated ${Class.name} ${humanReadableID} by changing ${key} from "+ oldMap[key] + " to " + newMap[key]

and then the simpler case for insert and delete:

"${actor} deleted ${Class.name} ${humanReadableID}"
"${actor} created ${Class.name} ${humanReadableID}"

which can nearly be created from the current columns in the generated audit table, the only value which is missing is the human readable unique Identifier, ( in the case of a product the unique identifier is the products part number). (And i guess it doesn't necessarily have to be unique, just understandable)

Finally in the domain class mark the human readable Identifier in some way maybe:

static auditable = [humanReadableID:partnum]

This may get a little more complex for many-to-many relations, but equally useful for an end user to understand whats changed in the system.

"Approval FCC added to Product TG-238"

maybe the ordering of the above sentence can be figured out with the belongsTo property?

I'm very new to Groovy so unable to really know how big a change this is, tried looking through the source but am struggling at the moment.

GPAUDITLOGGING-17: Grails Audit Facades and scrollable history

Original Reporter: hartsock
Environment: Not Specified
Version: Grails-AuditLogging 0.5
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-17

Create a way for users to ask for old versions of objects. For example if we do something like this...

def per = new Person(name:'Fred',dob:firstBirthDay)
per.save()
per.dob = newBirthDay
per.save()

We want to say:

def originalPer = per.findByNameAndVersion('Fred',0)

and get the original object from the database.

GPAUDITLOGGING-24: Over-ride the saveAuditLog closure via Config.groovy and decouple the 'Event' from the domain class

Original Reporter: criggs
Environment: Not Specified
Version: Grails-AuditLogging 0.5.4
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-24

While the saveAuditLog closure can be overridden already, it should follow the same convention as the closure for getting the current actor. Also, the Event class that is passed to the closure should not be a Domain class since this assumes that the save is using that domain class.

I've created a patch that allows for the save closure to be set from Config.groovy. It also renames the AuditLogEvent domain class to AuditLogEventRecord and adds a POGO AuditLogEvent class for passing to the save closure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.