简体   繁体   English

在 application.properties 中禁用 javers 审计

[英]Disable javers audit in application.properties

We are using Javers in our spring boot application and have several application.properties profiles, eg for different environments/local testing.我们在我们的 spring 引导应用程序中使用 Javers,并且有几个 application.properties 配置文件,例如用于不同的环境/本地测试。 In some profiles we would like to disable javers or if that's not possible, not persist the audit by using the default h2 repository.在某些配置文件中,我们希望禁用 javers,或者如果这不可能,则不使用默认的 h2 存储库来保留审计。

All our JpaRepositories are annotated with @JaversSpringDataAuditable.我们所有的 JpaRepositories 都带有 @JaversSpringDataAuditable 注释。 If we try to remove the mongoDB database connection from our application.properties, we get a com.mongodb.MongoTimeoutException.如果我们尝试从 application.properties 中删除 mongoDB 数据库连接,我们会得到 com.mongodb.MongoTimeoutException。

Does anyone know if there is a flag available in the application.properties that could either disable the audit or disable auditing into our mongodb and instead use the default h2 repository?有谁知道 application.properties 中是否有一个标志可以禁用审计或禁用对我们的 mongodb 的审计,而是使用默认的 h2 存储库?

That is an interesting case.这是一个有趣的案例。 There is no such flag but it looks like an easy thing to implement.没有这样的标志,但它看起来很容易实现。 Feel free to open a PR in https://github.com/javers/javers欢迎在https://github.com/javers/javers打开 PR

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM