-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
Question for WebApi: Audit only on statuscodes #620
Comments
You can accomplish what you want by setting up a custom action that discards the audit scope, so the audit event won't be saved: Audit.Core.Configuration.AddCustomAction(ActionType.OnEventSaving, scope =>
{
if (scope.GetWebApiAuditAction().ResponseStatusCode == 404)
{
scope.Discard();
}
}); Anyway, you can work on a PR if you want, very welcome! Take into account that:
|
Ahh thanks for the explanation I was mixing up Since I messed up that I ust want to be clear: I will give it a spin and see what comes out of it, feel free to reject the idea before it gets anywhere :D |
Hi
Is it possible, using the WebApi extension, to audit only if the response is of a given status code? There is already an
IncludeResponseBodyIf
option, and basically I would like a similar option for the entire Audit.Either like an:
AuditIf
option orIgnoreIfNot
.I might be willing to spend some time on a PR contribution if it fits with the design goals.
The text was updated successfully, but these errors were encountered: