You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The way the plugin is checking for the auditLog.disabled in the datasource:
if (!application.config.auditLog.disabled && !datastore.config.auditLog.disabled) {
appears to be the application config and not the datasource config, thus the disabled property is not there.
To access the auditLog.disabled property set in my datasource I have to call the datasource by name like : grailsApplication.config.dataSourceName.auditLog
Is there a unit test or anything that validates that the auditLog.disabled = true in the datasource works as intended?
The text was updated successfully, but these errors were encountered:
I've dug into this a little bit. I'm being affected by this issue for an application that is on Grails 2.3.11. We have added a second dataSource that is read-only (its actually a read-replica of our default dataSource), and want to disable audit-logging for the new dataSource.
I'm finding that during "grails run-app" its easy to make it work: the iterator in doWithApplicationContext that walks the org.grails.datastore.mapping.core.Datastore objects (one per dataSource) has a "sessionFactory.targetBean", which has a property "org.grails.internal.SESSION_FACTORY_HOLDER" (or "org.grails.internal.SESSION_FACTORY_HOLDER_${alternateDataSourceName}") which can be parsed to determine whether it represents the default dataSource or another. Once you have that, you can access the per-dataSource configuration value which marks it disabled.
When running in "run-war", these properties do not exist, and I could find no other property that would indicate the dataSource name for a given Datastore in doWithApplicationContext.
I concur there doesn't seem to be a simple way to make this happen in Grails 2.x. Maybe this feature should be removed, or replaced with another configuration method that is workable?
Original Reporter: hollowaybrad
Environment: Grails 2.4.3
Version: Grails-AuditLogging 1.0.1
Migrated From: http://jira.grails.org/browse/GPAUDITLOGGING-68
The way the plugin is checking for the auditLog.disabled in the datasource:
if (!application.config.auditLog.disabled && !datastore.config.auditLog.disabled) {
appears to be the application config and not the datasource config, thus the disabled property is not there.
To access the auditLog.disabled property set in my datasource I have to call the datasource by name like : grailsApplication.config.dataSourceName.auditLog
Is there a unit test or anything that validates that the auditLog.disabled = true in the datasource works as intended?
The text was updated successfully, but these errors were encountered: