Feature Request - add ActionExecutingContext parameters to Audit.WebApi
See original GitHub issueNot sure if it’s possible, I didn’t find a way.
I have a use case where I would like to add some ActionExecutingContext data to the Audit event, it seems like the current interface doesn’t allow it.
Something like that can work:
options.AddAuditFilter(config => config.LogAllActions()
.WithEventType("{verb}.{controller}.{action}")
.IncludeExtraParameteras(actionExecutingContext => actionExecutingContext.HttpContext["customParameter"]);
What do you think?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to get controller value in Action filter in Web API
How to get method name and Controller name in Action Filter and Exception Filter. public class ActionDetailAttribute : System.Web.
Read more >Implementing Action Filters in ASP.NET Core
Find out how to use action filters to write cleaner actions and create a reusable code to validate your actions in .NET Core...
Read more >Request Response Logging Middleware ASP.NET Core
Middleware. Here, in InvokeAsync() method, we are assigning values to the log model from HttpRequest and HttpResponse .
Read more >How to Audit Your ASP.NET Core WebApi
Add to services That's it! Run the api, make a http call and see the full audit log in standard output. Voilà !...
Read more >Filters in ASP.NET Core
Filters that are implemented as attributes and added directly to controller classes or action methods cannot have constructor dependencies ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @thepirat000, it works well, please note that I am using it in
AddOnSavingAction
but I tested it inAddCustomAction
as well:You may close, thanks!
This was added on version 14.8.1, please upgrade and re-test.