Serilog.Sinks.AzureTableStorage 9.0.0-beta.1.1

This is a prerelease version of Serilog.Sinks.AzureTableStorage.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Serilog.Sinks.AzureTableStorage --version 9.0.0-beta.1.1
                    
NuGet\Install-Package Serilog.Sinks.AzureTableStorage -Version 9.0.0-beta.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Serilog.Sinks.AzureTableStorage" Version="9.0.0-beta.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Serilog.Sinks.AzureTableStorage" Version="9.0.0-beta.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Serilog.Sinks.AzureTableStorage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Serilog.Sinks.AzureTableStorage --version 9.0.0-beta.1.1
                    
#r "nuget: Serilog.Sinks.AzureTableStorage, 9.0.0-beta.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Serilog.Sinks.AzureTableStorage@9.0.0-beta.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Serilog.Sinks.AzureTableStorage&version=9.0.0-beta.1.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Serilog.Sinks.AzureTableStorage&version=9.0.0-beta.1.1&prerelease
                    
Install as a Cake Tool

Serilog.Sinks.AzureTableStorage Nuget

Writes to a table in Azure Table Storage.

Package - Serilog.Sinks.AzureTableStorage | Platforms - .NET Standard 2.0

var log = new LoggerConfiguration()
    .WriteTo.AzureTableStorage("<connectionString>")
    .CreateLogger();

JSON configuration

It is possible to configure the sink using Serilog.Settings.Configuration by specifying the table name and connection string in appsettings.json:

"Serilog": {
  "WriteTo": [
    {"Name": "AzureTableStorage", "Args": {"storageTableName": "", "connectionString": ""}}
  ]
}

JSON configuration must be enabled using ReadFrom.Configuration(); see the documentation of the JSON configuration package for details.

XML <appSettings> configuration

To use the file sink with the Serilog.Settings.AppSettings package, first install that package if you haven't already done so:

Install-Package Serilog.Settings.AppSettings

Instead of configuring the logger in code, call ReadFrom.AppSettings():

var log = new LoggerConfiguration()
    .ReadFrom.AppSettings()
    .CreateLogger();

In your application's App.config or Web.config file, specify the file sink assembly and required path format under the <appSettings> node:

<configuration>
  <appSettings>
    <add key="serilog:using:AzureTableStorage" value="Serilog.Sinks.AzureTableStorage" />
    <add key="serilog:write-to:AzureTableStorage.connectionString" value="DefaultEndpointsProtocol=https;AccountName=ACCOUNT_NAME;AccountKey=KEY;EndpointSuffix=core.windows.net" />
    <add key="serilog:write-to:AzureTableStorage.formatter" value="Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact" />
  </appSettings>
</configuration>

Async approach

It is possible to configure the collector using Serilog.Sinks.Async to have an async approach.

Example Configuration for ASP.NET

public static class Program
{
    private const string OutputTemplate = "{Timestamp:HH:mm:ss.fff} [{Level:u1}] {Message:lj}{NewLine}{Exception}";

    public static async Task<int> Main(string[] args)
    {
        // azure home directory
        var homeDirectory = Environment.GetEnvironmentVariable("HOME") ?? ".";
        var logDirectory = Path.Combine(homeDirectory, "LogFiles");

        Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Verbose()
            .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
            .Enrich.FromLogContext()
            .WriteTo.Console(outputTemplate: OutputTemplate)
            .WriteTo.File(
                path: $"{logDirectory}/boot.txt",
                rollingInterval: RollingInterval.Day,
                shared: true,
                flushToDiskInterval: TimeSpan.FromSeconds(1),
                outputTemplate: OutputTemplate,
                retainedFileCountLimit: 10
            )
            .CreateBootstrapLogger();

        try
        {
            Log.Information("Starting web host");

            var builder = Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(args);

            builder.Host
                .UseSerilog((context, services, configuration) => configuration
                    .ReadFrom.Configuration(context.Configuration)
                    .ReadFrom.Services(services)
                    .Enrich.FromLogContext()
                    .Enrich.WithProperty("ApplicationName", builder.Environment.ApplicationName)
                    .Enrich.WithProperty("EnvironmentName", builder.Environment.EnvironmentName)
                    .WriteTo.Console(outputTemplate: OutputTemplate)
                    .WriteTo.File(
                        path: $"{logDirectory}/log.txt",
                        rollingInterval: RollingInterval.Day,
                        shared: true,
                        flushToDiskInterval: TimeSpan.FromSeconds(1),
                        outputTemplate: OutputTemplate,
                        retainedFileCountLimit: 10
                    )
                    .WriteTo.AzureTableStorage(
                        connectionString: context.Configuration.GetConnectionString("StorageAccount"),
                        propertyColumns: new[] { "SourceContext", "RequestId", "RequestPath", "ConnectionId", "ApplicationName", "EnvironmentName" }
                    )
                );

            ConfigureServices(builder);

            var app = builder.Build();

            ConfigureMiddleware(app);

            await app.RunAsync();

            return 0;
        }
        catch (Exception ex)
        {
            Log.Fatal(ex, "Host terminated unexpectedly");
            return 1;
        }
        finally
        {
            await Log.CloseAndFlushAsync();
        }
    }

    private static void ConfigureServices(WebApplicationBuilder builder)
    {
    }

    private static void ConfigureMiddleware(Microsoft.AspNetCore.Builder.WebApplication app)
    {
    }
}

Change Log

9.0.0

  • Breaking: Due to issue with creating provides from configuration
    • IDocumentFactory.Create add AzureTableStorageSinkOptions and IKeyGenerator arguments
    • IKeyGenerator.GeneratePartitionKey add AzureTableStorageSinkOptions argument
    • IKeyGenerator.GenerateRowKey add AzureTableStorageSinkOptions argument
  • Fix: DefaultDocumentFactory and DefaultKeyGenerator needed paramaterless contructor for use in configuration files
  • Add: ITableClientFactory to control TableClient creation

8.5.0

  • Add option for partition key rounding
  • Move IKeyGenertor from options
  • Add DateTime extension methods for partition key and row key
  • Add sample web project

8.0.0

  • Breaking: major refactor to simplify code base
    • Removed: AzureTableStorageWithProperties extension removed, use equivalent AzureTableStorage
    • Removed: ICloudTableProvider provider removed
    • Added: IDocumentFactory to allow control over table document
    • Change: PartitionKey and RowKey changed to new implementation

7.0.0

  • Update dependencies: repace Microsoft.Azure.Cosmos.Table with Azure.Data.Tables

6.0.0

  • Updated dependencies: replace deprecated package WindowsAzure.Storage with Microsoft.Azure.Cosmos.Table 1.0.8
  • Updated dependencies: Serilog 2.10.0

5.0.0

  • Migrated to new CSPROJ project system
  • Updated dependencies: WindowsAzure.Storage 8.6.0, Serilog 2.6.0, Serilog.Sinks.PeriodicBatching 2.1.1
  • Fix #36 - Allow using SAS URI for logging.

1.5

  • Moved from serilog/serilog
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (12)

Showing the top 5 NuGet packages that depend on Serilog.Sinks.AzureTableStorage:

Package Downloads
TouchConvert.Tenant.Api.V1.Dtos

Data transfer objects for TouchConvert version one APIs.

TouchConvert.Tenant.Api.V2.Dtos

Data transfer objects for TouchConvert version two APIs.

BumperLane.Hosted.Api.V2.Application

BumperLane Core API functionality

Indiko.Blocks.Logging.Serilog

Building Blocks Logging Serilog

AzureWebFarm.OctopusDeploy

Scalable, OctopusDeploy-powered webfarm using Windows Azure Web Roles.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.2.0 2,131 8/28/2025
10.1.0 119,102 1/16/2025
10.0.2 82,386 10/26/2024
10.0.1 90,575 7/26/2024
10.0.0 20,624 7/10/2024
10.0.0-beta.1 2,074 6/3/2024
9.7.1 129,838 5/29/2024
9.7.0 11,647 5/10/2024
9.6.0 69,767 4/26/2024
9.5.0 37,352 4/10/2024
9.4.1 30,922 3/10/2024
9.3.0 2,972 3/6/2024
9.2.0 82,324 12/11/2023
9.1.0 26,985 11/9/2023
9.0.0 94,938 8/6/2023
9.0.0-beta.2 189 8/1/2023
9.0.0-beta.1.1 184 8/1/2023
8.5.42-alpha.0.7 177 8/1/2023
8.5.41 43,424 6/24/2023
8.5.39-beta 632 6/24/2023
8.5.38 88,668 5/8/2023
8.5.36-beta 684 5/2/2023
8.0.35 9,077 4/16/2023
8.0.33-beta 612 4/16/2023
8.0.31-beta 688 4/16/2023
8.0.30-beta 676 4/11/2023
8.0.28-beta 713 4/10/2023
8.0.27-beta 725 3/27/2023
7.0.25 53,511 3/25/2023
7.0.22-beta 743 3/25/2023
6.0.0-dev-00146 20,933 4/29/2021
5.0.0 1,582,609 7/28/2020
5.0.0-dev-00116 100,289 9/8/2018
5.0.0-dev-00111 2,634 9/4/2018
5.0.0-dev-00109 1,350 9/4/2018
5.0.0-dev-00105 8,431 5/9/2018
5.0.0-dev-00101 1,818 4/24/2018
5.0.0-dev-00093 7,107 3/20/2018
4.0.0 1,708,186 6/13/2017
4.0.0-dev-00089 1,880 5/22/2017
4.0.0-dev-00082 5,072 3/14/2017
4.0.0-dev-00079 1,851 3/4/2017
4.0.0-dev-00077 1,727 3/1/2017
4.0.0-dev-00074 1,640 2/28/2017
4.0.0-dev-00069 3,095 2/13/2017
3.0.1-dev-00067 3,585 2/3/2017
3.0.0 203,468 11/22/2016
3.0.0-dev-00055 1,745 10/14/2016
3.0.0-dev-00052 1,664 10/7/2016
3.0.0-dev-00045 2,617 10/6/2016
3.0.0-dev-00044 2,808 10/3/2016
3.0.0-dev-00039 1,849 10/3/2016
2.0.1-dev-00030 2,756 7/19/2016
2.0.0 58,156 6/29/2016
2.0.0-beta-20 2,720 4/26/2016
1.5.14 37,806 4/17/2016
1.5.11 13,265 12/26/2015
1.5.5 32,960 4/2/2015
1.5.4 3,387 4/2/2015
1.5.3 2,098 4/1/2015
1.5.2 2,859 3/30/2015
1.5.1 2,028 3/27/2015
1.4.196 2,745 2/22/2015
1.4.182 2,318 2/15/2015
1.4.168 2,253 2/8/2015
1.4.155 2,129 2/1/2015
1.4.139 2,004 1/23/2015
1.4.118 2,140 1/13/2015
1.4.113 2,312 1/6/2015
1.4.102 2,592 12/21/2014
1.4.99 2,439 12/18/2014
1.4.97 2,338 12/18/2014
1.4.76 2,356 12/8/2014
1.4.75 2,311 12/7/2014
1.4.39 2,229 11/26/2014
1.4.34 2,171 11/24/2014
1.4.28 2,173 11/24/2014
1.4.27 2,282 11/23/2014
1.4.23 2,332 11/21/2014
1.4.22 2,211 11/21/2014
1.4.21 2,182 11/21/2014
1.4.18 2,347 11/18/2014
1.4.15 2,548 11/4/2014
1.4.14 2,149 10/23/2014
1.4.13 2,099 10/23/2014
1.4.12 2,231 10/12/2014
1.4.11 2,037 10/8/2014
1.4.10 2,847 9/26/2014
1.4.9 2,187 9/17/2014
1.4.8 2,160 9/11/2014
1.4.7 2,748 9/1/2014
1.4.6 2,104 8/31/2014
1.4.5 2,038 8/27/2014
1.4.4 2,118 8/27/2014
1.4.3 3,103 8/25/2014
1.4.2 1,977 8/23/2014
1.4.1 2,023 8/23/2014
1.3.43 2,158 8/4/2014
1.3.42 2,043 7/30/2014
1.3.41 2,031 7/28/2014
1.3.40 2,040 7/26/2014
1.3.39 2,106 7/25/2014
1.3.37 2,056 7/25/2014
1.3.36 2,069 7/20/2014
1.3.35 2,048 7/17/2014
1.3.34 2,022 7/6/2014
1.3.33 2,053 6/30/2014
1.3.30 2,060 6/19/2014
1.3.29 2,049 6/19/2014
1.3.28 2,070 6/19/2014
1.3.27 2,053 6/18/2014
1.3.26 2,050 6/18/2014
1.3.25 2,075 6/9/2014
1.3.24 2,102 5/21/2014
1.3.23 2,037 5/20/2014
1.3.20 2,133 5/18/2014
1.3.19 2,087 5/17/2014
1.3.18 2,062 5/17/2014
1.3.17 2,079 5/17/2014
1.3.16 2,043 5/17/2014
1.3.15 2,065 5/16/2014
1.3.14 2,060 5/16/2014
1.3.13 2,040 5/16/2014
1.3.12 2,015 5/14/2014
1.3.7 2,054 5/11/2014
1.3.6 2,068 5/9/2014
1.3.5 2,109 5/6/2014
1.3.4 2,040 5/4/2014
1.3.3 2,170 4/28/2014
1.3.1 2,333 4/26/2014
1.2.53 2,153 4/26/2014
1.2.52 2,197 4/24/2014
1.2.51 2,276 4/18/2014
1.2.50 2,262 4/18/2014
1.2.49 2,184 4/17/2014
1.2.48 2,292 4/14/2014
1.2.47 2,259 4/14/2014
1.2.45 2,251 4/13/2014
1.2.44 2,276 4/9/2014
1.2.41 2,521 4/7/2014
1.2.40 2,147 4/7/2014
1.2.39 2,563 3/29/2014
1.2.38 2,156 3/29/2014
1.2.37 2,198 3/29/2014
1.2.29 2,424 3/16/2014
1.2.27 2,151 3/14/2014
1.2.26 2,126 3/12/2014
1.2.25 3,845 2/20/2014
0.9.9 2,870 11/23/2013
0.9.1 2,952 8/24/2013
0.8.6 2,272 7/29/2013
0.8.5 2,372 7/22/2013
0.8.1 2,402 7/9/2013
0.7.2 2,368 7/6/2013
0.6.1 2,290 6/13/2013
0.5.2 2,340 5/27/2013
0.5.1 2,227 5/26/2013
0.4.3 2,787 5/25/2013