哨兵不记录请求有效载荷在.NET中
最近我开始使用 Sentry 来记录错误日志。我使用此代码片段进行连接:
webBuilder.UseSentry(o =>
{
o.Dsn = settings.GetConnectionString("Sentry"); // env variable
o.AttachStacktrace = true;
o.TracesSampleRate = 1;
o.IncludeActivityData = true;
});
这工作正常并且记录错误,但我注意到请求负载未记录。我在网上查找了一些教程并发现了有关 IncludeRequestPayload = true
但在我的情况下它不存在。我在 .NET 3.1 中使用 Sentry.AspNetCore 版本 3.16.0
。您知道是否可以使用此版本记录有效负载,如果可以,我该怎么做?
Recently I started using Sentry for error logs. I use this snippet to connect:
webBuilder.UseSentry(o =>
{
o.Dsn = settings.GetConnectionString("Sentry"); // env variable
o.AttachStacktrace = true;
o.TracesSampleRate = 1;
o.IncludeActivityData = true;
});
This works fine and it logs errors but I noticed that request payload is not logged. I looked for some tutorials online and found about IncludeRequestPayload = true
but in my case it doesn't exist. I use Sentry.AspNetCore version 3.16.0
within a .NET 3.1. Do you know if it's possible to log the payload with this version and if so, how can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法自己解决了。对于那些偶然发现类似内容的任何人,您只需要将
maxRequestBodySize
添加到sentry.extensibility.requestsize.always.always.always
,尽管 docs 。I managed to solve it myself. For anyone that stumbles upon something like this, you just need to add a
MaxRequestBodySize
toSentry.Extensibility.RequestSize.Always
, although not well described in docs.