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

Allow to write audit logs on exceptions even if disabled for GET requests #2277

Closed
2 tasks done
hikalkan opened this issue Nov 28, 2019 · 2 comments · Fixed by #2625
Closed
2 tasks done

Allow to write audit logs on exceptions even if disabled for GET requests #2277

hikalkan opened this issue Nov 28, 2019 · 2 comments · Fixed by #2625

Comments

@hikalkan
Copy link
Member

hikalkan commented Nov 28, 2019

  • Add an option to save audit logs on exceptions on GET requests even if audit log is disabled for GET requests.
  • Handle exceptions in the AuditLogMiddleware those might not be handled in the Audit action filter.
@gterdem
Copy link
Contributor

gterdem commented Dec 27, 2019

We can implement an enum named something like AuditLogLevel with;

  • AuditLogLevel.All (log both gets and posts)
  • AuditLogLevel.PostOnly (logs only posts)
  • AuditLogLevel.ExceptionOnly (logs only exceptions of gets and posts)
  • AuditLogLevel.None (no logging to db, only logs exceptions to file via ILogger)

What do you think @hikalkan? Is this seems a valid approach?

@hikalkan
Copy link
Member Author

Instead add public bool AlwaysLogOnException { get; set; } = false;

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

Successfully merging a pull request may close this issue.

2 participants