【问题标题】:Configuring AzureTableStorage Serilog sink from config file从配置文件配置 AzureTableStorage Serilog 接收器
【发布时间】:2017-06-08 16:03:52
【问题描述】:

Serilog 的 Azure 表存储接收器能否像其他接收器一样通过 app/Web.config 配置,例如 Elasticsearch 和 Seq,可以从配置文件进行配置。

AzureTableStorage 接收器的 github 页面仅显示基于代码的配置。

谢谢

【问题讨论】:

    标签: serilog


    【解决方案1】:

    我能够解决这个问题:

    <add key="serilog:using" value="Serilog.Sinks.AzureTableStorage" />
    <add key="serilog:write-to:AzureTableStorageWithProperties.connectionString" value="DefaultEndpointsProtocol=https;AccountName=someaccount;AccountKey=uJeYNoa/4dKKtH3zG+7YlA==;EndpointSuffix=core.windows.net" />
    <add key="serilog:write-to:AzureTableStorageWithProperties.storageTableName" value="my-logs" />
    

    有了这个,我可以看到 StorageExplorer 中的日志

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多