I am looking for a way to use the CustomData field in AbpAuditLogs. What is the correct way to add data to this field?
3 Answer(s)
-
0
Hi,
You can create a custom AuditInfoProvider which derives from DefaultAuditInfoProvider. <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/a706b7e8f497a4afe2bb746892fd6c010b0875fc/src/Abp/Auditing/NullAuditInfoProvider.cs">https://github.com/aspnetboilerplate/as ... rovider.cs</a>.
Then you need to replace default implementation with yours in the PreInitialize method of your module.
Configuration.ReplaceService<IAuditInfoProvider, MyCustomAuditInfoProvider>();
-
0
thanks, I got that far. However, How do I hook into the Fill call to set the CustomData field?
-
0
Hi,
I couldn't understand your problem. When you create a new class, lets say MyCustomAuditInfoProvider, and use replace service for IAuditInfoProvider, ABP will automatically call your new MyCustomAuditInfoProvider's Fill method instead of it's default IAuditInfoProvider implementation.
If this is not the case for you, can you explaint it a bit more detailed.