Abp: DisableAuditing not works for SimpleLogAuditingStore

Created on 19 Apr 2020  路  5Comments  路  Source: abpframework/abp

I got this issue when I use SimpleLogAuditingStore, it works a few months ago. but not works for current version any more.
here is the code below:

context.Services.Replace(ServiceDescriptor.Singleton<IAuditingStore, SimpleLogAuditingStore>());

For log config in Program.cs

.Enrich.FromLogContext()
.WriteTo.Async(x => x.Console())

Add a attribute to any application service

[AllowAnonymous]
[DisableAuditing]
public async Task<LoginResult> LoginAsync(LoginInput input)

Then I got this output on the console:

[14:40:31 INF] AUDIT LOG: [200: POST   ] /api/app/user/login
- UserName - UserId                 :  -
- ClientIpAddress        : ::1
- ExecutionDuration      : 204

can you take a look please?

Most helpful comment

en...I see..... nice to have. cause I have a lot of recurring jobs that output massive logs.

All 5 comments

I will check this.

In fact, the AuditLogAction will not be recorded, but the audit log middleware will record an AuditLog so you will see it in the output.

https://github.com/abpframework/abp/blob/9212f2a7f86d809a640eed5a4705c3e3e83015e4/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs#L50

I am not sure if this is by design. @maliming What do you think?

en...I see..... nice to have. cause I have a lot of recurring jobs that output massive logs.

You can customize IAuditingStore to filter some logs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leonkosak picture leonkosak  路  3Comments

zsanhong picture zsanhong  路  3Comments

mehdihadeli picture mehdihadeli  路  3Comments

vfabregat picture vfabregat  路  3Comments

ChangYinShung picture ChangYinShung  路  3Comments