Search code examples
dependency-injectionconfigurationaspnetboilerplate

ABP doesn't call custom Audit Store implementation


I'm working with ABP version 0.9.1.0.

I need to implement my own Audit Store. I follow the guidelines in the documentation; I just create a class that is identical to SimpleLogAuditingStore and I only change its name to DBAuditStore.

I also read this post: https://forum.aspnetboilerplate.com/viewtopic.php?f=2&t=340, but it seems that doesn't work.

When I throw an Exception in my Application Service Layer, it doesn't execute my DBAuditStore.Save method.

Is there any config to make my custom Audit Store the default?


Solution

  • You should replace IAuditingStore in your module:

    // using Abp.Configuration.Startup;
    
    public override void PreInitialize()
    {
        Configuration.ReplaceService<IAuditingStore, DBAuditStore>();
    }