Configuring AzureTableStorage Serilog sink from config file

时间:2017-06-08 16:03:53

标签: serilog

Can the Azure Table Storage sink for Serilog be configured via the app/Web.config like other sinks, eg Elasticsearch and Seq, which can be configured from the configuration files.

The github page for AzureTableStorage sink shows only code based configuration.

Thanks

1 个答案:

答案 0 :(得分:2)

我能够弄清楚这一点:

<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中的日志