abp icon indicating copy to clipboard operation
abp copied to clipboard

Reuse entitychanges logic to insert in other audit database

Open luisp88 opened this issue 6 years ago • 2 comments

I'm using a template solution on abp 2.9 EF core and added one project to handle mongo repository, so same app is using both, sql server and mongo. I need to record the entity changes to a custom table (property name, old value, new value, other own properties). I'm aware that entity changes are not supported for mongo entities.

How can I override the logic or where should mine be inserted for both cases (sql & mongo)? I've seen that the entity changes are loaded to log objects inside AbpDbContext.

Thanks in advance.

luisp88 avatar Jun 09 '20 21:06 luisp88

Hi, See https://docs.abp.io/en/abp/latest/Audit-Logging#audit-log-contributors

realLiangshiwei avatar Jun 10 '20 01:06 realLiangshiwei

You can save audit logs into any database or destination you like.

Just implement & replace the IAuditingStore interface. If you implement it yourself, you can also remove Audit-logging module from your application, since its main function is to implement this interface.

hikalkan avatar Jun 14 '20 16:06 hikalkan