繁体   English   中英

使用Serilog同时记录到AzureTableStorage

[英]logging with Serilog Concurrently to AzureTableStorage

与登录文件相比,登录到AzureTableStorage会导致开销,从而阻止下次调用。是否有一种方法可以使此过程更快(批处理或异步选项)?

我在appsetttings.josn中的代码:

"Serilog": {
    "MinimumLevel": "Information",
    "WriteTo": [
      {
        "Name": "AzureTableStorage",
        "Args": {
          "storageTableName": "tbl",
          "connectionString": "DefaultEndpointsProtocol=http;AccountName=xxx;AccountKey=/xxxxxxxx"
        }
      }
    ]
  }

我最终使用https://github.com/serilog/serilog-sinks-async和AzureTableStorage中的批处理选项,类似于:

"WriteTo": [
            {
                "Name": "Async",
                "Args": {
                    "configure": [
                        {
                            "Name": "AzureTableStorage",
                            "Args": {
                                "storageTableName": "tbl",
                                "connectionString": "DefaultEndpointsProtocol=http;AccountName=xxx;AccountKey=xxx"
                            }
                        }
                    ]
                }
            }
        ]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM