Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring AzureTableStorage Serilog sink from config file

Tags:

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

like image 308
sppc42 Avatar asked Dec 11 '25 04:12

sppc42


1 Answers

I was able to figure this out:

<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" />

With this, am able to see the logs coming in StorageExplorer

like image 101
sppc42 Avatar answered Dec 15 '25 07:12

sppc42



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!