Open
Description
Describe the bug
Using the following to configure APItoolkit in my .Net 8 ASP.NET Core API, I do not get anything in the endpoint logs' RequestBody. ResponseBody has expected values:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
...
// Initialize the APItoolkit client
var config = new Config
{
ApiKey = "<API KEY>",
Debug = false,
Tags = ["external_api"],
ServiceVersion = "v2.0",
RedactResponseBody = ["$.ownerEmail"],
RedactRequestBody = ["$.ownerEmail"]
};
var client = APIToolkit.NewClientAsync(config).Result;
// END Initialize the APItoolkit client
// Register the middleware to use the initialized client
app.Use(async (context, next) =>
{
// added this line based on searching for issue, didn't help:
context.Request.EnableBuffering();
var apiToolkit = new APIToolkit(next, client);
await apiToolkit.InvokeAsync(context);
});
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
...
To Reproduce
No response
System
Windows 11 (have not tried deployed to Azure App Service yet)
Additional context
No response