Open Closed

How to disable auditlogging outside of middleware? #7065


User avatar
0
jkrause created
  • ABP Framework version: v8.0.5
  • UI Type: Razor Pages
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: not applicable
  • Steps to reproduce the issue:

We wanted to understand how audit logging is produced, so we decided to first override the AuditLogMiddleware from ABP and disable the write of the audit log info. If we then refresh the page and check auditlog we still see information being written to data base:

  • /abp/applicationlocalizationscript
  • /abp/applicationconfigurationscript
  • /api/** calls

Could you let us know where and how these are logged to audit log? Or how they are bypassing the middleware? Can we disable audit logging for only API controllers? Do we need to override the Interceptor too?


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Could you let us know where and how these are logged to audit log? Or how they are bypassing the middleware? Can we disable audit logging for only API controllers? Do we need to override the Interceptor too?

    You can override the AuditingManager or AuditingStore to decide which logs can be written to the database.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs#L115-L117 https://github.com/abpframework/abp/blob/dev/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditingStore.cs#L52-L59

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11