c# - 使用 HttpClient 的 NLog 重复属性
问题描述
我有来自我的 HttpClient 的 nLog 日志记录请求,然后将该数据写入 Kinesis 中的流,该流传送到 AWS Elastic Search。我的大多数日志都可以正常交付,但有些日志无法交付,因为它们在 JSON 有效负载中具有重复的对象键。
这是失败日志的示例
{
"Application": "TestApplication",
"Environment": "DEV",
"HostName": "xxxxxxxxx",
"@timestamp": "2021-06-16T05:17:53.005+00:00",
"Level": "INFO",
"Logger": "System.Net.Http.HttpClient.Default.LogicalHandler",
"Message": "Start processing HTTP request POST https:\/\/example.com/",
"ConnectionId": "xxxxxxxxx",
"RequestId": "xxxxxxxxxx",
"RequestPath": "\/somepath\/someotherpath",
"CorrelationId": "xxxxxxxxxxxx",
"ActionId": "xxxxxxxxxxxxx",
"ActionName": "xxxxxxxxxxx",
"HttpMethod": "POST",
"Uri": "https:\/\/example.com\/",
"HttpMethod": "POST", <----- Dupe
"Uri": "https:\/\/example.com\/", <----- Dupe
"EventId_Id": 100,
"EventId_Name": "RequestPipelineStart",
"EventId": "RequestPipelineStart"
}
注意上面有两个重复的键HttpMethod
和Uri
. 我不知道从哪里开始调试,因为这似乎是直接来自其中LogicHandler
一些失败日志或`ClientHandler.
有没有人遇到过这个?
解决方案
推荐阅读
- imagemagick - 需要将 ImageMagick 脚本转换为 Imagick
- python - 是否可以使用 CATIA 中的宏移动零件?
- python - 将数字 11-14 替换为字符串 jack、queen、king、ace
- android - 使用 Firemonkey/Delphi 打开 Android 26 的 PDF 文件时出现异常
- excel - CtrlShftDown 和定义的列以清除选择
- java - 运行时异常不可序列化
- javascript - 动态设置chart.js堆积条形图数据
- mirth - 在 Mirth and Database 中处理 HL7 数据的优化方式可能是什么?
- python - 如何在谷歌云上构建 Node.JS 移动后端
- python - 仅当字符串匹配时才在 python 中连接字符串