New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use IAuditingConfiguration.IsEnable property to totaly disable audit function #721
Comments
It's enabled by default. Use this code to disable it:
This code should be in PreInitialize method of your module. |
Thanks for your reply, I see this Used in the AbpKernelModule PreInitialize() method, but as I know the AbpKernelModule is the top module, I think my module's PreInitialize method woudn't run before the AbpKeneralModule's PreInitialize method, How do you think? |
AbpKernelModule runs first since all modules depend on it (http://www.aspnetboilerplate.com/Pages/Documents/Module-System#DocModuleLifecycleEvents) |
As your Lifecycle said, If i have a custome Module called MyModule that DependsOn AbpKernalModule, Before MyModule's PreInitialize method call, the AbpKernelModule's PreInitalize already executed, So If I added the code |
Hi, As you can see, AbpKernelModule has not a code that enabled/disables AuditLogging: https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/AbpKernelModule.cs#L31 So, your module's PreInitialize runs after AbpKernelModule's preinitialize and disables it. Please try it, it will work ;) |
AbpKernelModule |
OK, I now see. AuditingInterceptor was checking IsEnabled before, but I removed it. |
Hope we can got fixed version quickly! :):) |
Hi, Did you try it? Because, https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Auditing/AuditingInterceptor.cs#L43 checks before every audit logging. And https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Auditing/AuditingHelper.cs#L11 checks IsEnabled. So, IsEnabled is also checked for every audit logging. |
Yes, I see it, I just found https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Auditing/AuditingInterceptorRegistrar.cs#L17 is not resonable, |
Yes, I think so. But at least it works as expected. (added a unit test shows it works: 6edbe5b) |
…ed for registering the interceptor.
In the AbpBootstrapper.Initialize(); it will register the IAuditingConfiguration and also will init the AuditingRegister, in the registor, it will use the IAuditingConfiguration.IsEnable value, so my question is does have any chance that allow me to set the IAuditingConfiguration.IsEnable In my application?
The text was updated successfully, but these errors were encountered: