I wish to write out every request coming into my API, to a log (via
ILogging abstraction), and have those logs sent off to Application Insights.
Obviously, I could do this myself with any number of built-in extensibility mechanisms, like a
GlobalFilter, and just use the
(I have already configured the logs to go to AI in production).
I do NOT want to enable the
RequestLogsFeature in production, as having that endpoint available in production would be considered a data breach potential, should a person be able to read those requests in production.
BUT, it already does most of what I need to do with request logging, such as sanitizing certain requests types, etc.
Is it feasible to use the
RequestLogsFeature, and disable its endpoint (
AtRestPath=null), and not bother storing any past requests.
Does the feature already send the requests and responses to the
ILogger abstraction, once they have run through the filters configured in the feature (ie. the