Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisableAuditing not works for SimpleLogAuditingStore #3662

Closed
tohkinzhu opened this issue Apr 19, 2020 · 5 comments
Closed

DisableAuditing not works for SimpleLogAuditingStore #3662

tohkinzhu opened this issue Apr 19, 2020 · 5 comments

Comments

@tohkinzhu
Copy link

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?

@realLiangshiwei
Copy link
Member

I will check this.

@realLiangshiwei
Copy link
Member

realLiangshiwei commented Apr 19, 2020

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.

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

@maliming
Copy link
Member

#2820 (comment)

@tohkinzhu
Copy link
Author

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

@maliming
Copy link
Member

You can customize IAuditingStore to filter some logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants