I have a C# app exposing a restful endpoint, which takes FormFiles as input. I’m hoping to capture these FormFiles whenever an exception is thrown, so I’ve configured the ASP.NET Core integration:
Host.CreateDefaultBuilder(args.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseSentry(options =>
{
options.MaxRequestBodySize = RequestSize.Small;
options.Debug = true;
}
});
When an exception is thrown, I see that Sentry is ignoring my request because it’s too large:
Ignoring request with Size 116028 and configuration RequestSize Small
Ok, that makes sense. So I change the configuration to always capture the request:
options.MaxRequestBodySize = RequestSize.Always;
Sentry doesn’t write any warnings to my logs. But I also can’t find the request logged anywhere in Sentry. Is the request hiding somewhere in Sentry that I’m not seeing? Or does Sentry not successfully capture FormFiles?
I’m using the latest version of the Sentry SDK:
<PackageReference Include="Sentry.AspNetCore" Version="3.10.0" />