I am using Hibernate Envers in my Grails app, and trying to set the org.hibernate.envers.audit_strategy property. What is the correct way to configure this?
I have tried adding the following to application.yml:
org.hibernate:
envers:
audit_strategy: 'org.hibernate.envers.strategy.ValidityAuditStrategy'
I tried several variations on this, and also tried setting it in application.groovy, but I cannot get Envers to read it.
I'd rather include it in the project source, and not set it on the command line.
Update:
Another config that does not work (application.yml):
hibernate:
additionalProperties:
org.hibernate:
envers:
audit_strategy: 'org.hibernate.envers.strategy.ValidityAuditStrategy'
Update 2:
I noticed in the debugger that there is a nested map in the config, as shown in the screenshot below. This prevents AuditEntitiesConfiguration from reading the property correctly, since it's just using map.get.
Why is this happening? Is there something wrong with my YAML format?
I tried simplifying my YAML setting for this property down to one line, but it didn't help:
org.hibernate.envers.audit_strategy: 'org.hibernate.envers.strategy.ValidityAuditStrategy'

I found that I could make it work by modifying the
Applicationclass:I'm open to better solutions.