VOOZH about

URL: https://www.nuget.org/packages/Serilog.Sinks.AzureTableStorage/

⇱ NuGet Gallery | Serilog.Sinks.AzureTableStorage 10.2.0




👁 Image
Serilog.Sinks.AzureTableStorage 10.2.0

dotnet add package Serilog.Sinks.AzureTableStorage --version 10.2.0
 
 
NuGet\Install-Package Serilog.Sinks.AzureTableStorage -Version 10.2.0
 
 
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="10.2.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Serilog.Sinks.AzureTableStorage" Version="10.2.0" />
 
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 10.2.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Serilog.Sinks.AzureTableStorage, 10.2.0"
 
 
#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@10.2.0
 
 
#: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=10.2.0
 
Install as a Cake Addin
#tool nuget:?package=Serilog.Sinks.AzureTableStorage&version=10.2.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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();

Configuration

Configuration Description Default
connectionString The Cloud Storage Account connection string
sharedAccessSignature The storage account/table SAS key
accountName The storage account name
restrictedToMinimumLevel The minimum log event level required in order to write an event to the sink. Verbose
formatProvider Culture-specific formatting information
storageTableName Table name that log entries will be written to LogEvent
batchPostingLimit The maximum number of events to post in a single batch 100
period The time to wait between checking for event batches 0:0:2
keyGenerator The key generator used to create the PartitionKey and the RowKey for each log entry DefaultKeyGenerator
propertyColumns Specific log event properties to be written as table columns
bypassTableCreationValidation Bypass the exception in case the table creation fails false
documentFactory Provider to create table document from LogEvent DefaultDocumentFactory
tableClientFactory Provider to create table client DefaultTableClientFactory
partitionKeyRounding Partition key rounding time span 0:5:0

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>

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

10.0.0

  • Breaking: writeInBatches removed, all writes are now batched
  • Update: update to serilog 4.0
  • Remove: removed dependance on Serilog.Sinks.PeriodicBatching, use serilog 4.0 IBatchedLogEventSink

9.6.0

  • Fix: improve timezone support

9.5.0

  • Add: use ULID for rowkey for speed and efficiency

9.4.0

  • Fix: prevent duplicate rowkey

9.1.0

  • Add: Built-in trace and span id support

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 Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 is compatible. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.

Indiko.Blocks.Logging.Serilog

Building Blocks Logging Serilog

BumperLane.Hosted.Api.V2.Application

BumperLane Core API functionality

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 179,317 8/28/2025
10.1.0 242,989 1/16/2025
10.0.2 111,332 10/26/2024
10.0.1 150,597 7/26/2024
10.0.0 28,546 7/10/2024
10.0.0-beta.1 2,264 6/3/2024
9.7.1 162,088 5/29/2024
9.7.0 15,808 5/10/2024
9.6.0 71,037 4/26/2024
9.5.0 46,888 4/10/2024
9.4.1 41,548 3/10/2024
9.3.0 4,588 3/6/2024
9.2.0 111,672 12/11/2023
9.1.0 34,210 11/9/2023
9.0.0 113,980 8/6/2023
9.0.0-beta.2 256 8/1/2023
9.0.0-beta.1.1 264 8/1/2023
8.5.42-alpha.0.7 253 8/1/2023
8.5.41 48,882 6/24/2023
8.5.39-beta 738 6/24/2023
Loading failed