Open Closed

DisableAuditing lose efficacy #9834


User avatar
0
1198462239 created

Even though DisableAuditing was used, the auditing logs were still recorded.


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

    hi

    Could you please share more details/log and screenshots?

    Thanks.

  • User Avatar
    0
    1198462239 created

    This is a screenshot. I have tried it and found that some parts work while others don't.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can disable it by url.

  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • To disable auditing in ABP Framework, you should use the [DisableAuditing] attribute on your class, method, or property. This attribute prevents audit logs from being recorded for the decorated element.

    • If you have applied [DisableAuditing] but still see audit logs being recorded, ensure the following:

      1. The attribute is applied to the correct target (class, method, or property).
      2. The entity or method is not included in AbpAuditingOptions.AlwaysLogSelectors or similar configuration that forces auditing.
      3. The entity is not being audited due to other global selectors or contributors.
      4. The type is not included in AbpAuditingOptions.IgnoredTypes (which disables auditing, but if not set, auditing may still occur).
    • Example usage:

    [DisableAuditing]
      public class MyEntity : Entity<Guid>
      {
          public string Name { get; set; }
          public string Email { get; set; }
          public string Password { get; set; }
      }
    
    • If you want to disable auditing for specific properties only:
    [Audited]
      public class MyUser : Entity<Guid>
      {
          public string Name { get; set; }
          public string Email { get; set; }
          [DisableAuditing] // This property will not be audited
          public string Password { get; set; }
      }
    
    • If you want to audit only specific properties and ignore all others:
    [DisableAuditing]
      public class MyUser : Entity<Guid>
      {
          [Audited] // Only this property will be audited
          public string Name { get; set; }
          public string Email { get; set; }
          public string Password { get; set; }
      }
    
    • If you have confirmed all the above and auditing is still not disabled, check for custom audit log contributors or overridden auditing stores in your solution that may bypass the attribute.

    • For more details, see the official documentation.

    Sources:

    • https://abp.io/docs/latest/framework/infrastructure/audit-logging

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 01, 2025, 08:37