diff --git a/src/Easify.Azure.Serilog/AzureLogAnalyticsOptions.cs b/src/Easify.Azure.Serilog/AzureLogAnalyticsOptions.cs
new file mode 100644
index 0000000..31aa997
--- /dev/null
+++ b/src/Easify.Azure.Serilog/AzureLogAnalyticsOptions.cs
@@ -0,0 +1,11 @@
+namespace Easify.Azure.Serilog
+{
+ public sealed class AzureLogAnalyticsOptions
+ {
+ public string WorkspaceId { get; set; }
+ public string AuthenticationId { get; set; }
+ public string LogName { get; set; }
+ public int? LogBufferSize { get; set; }
+ public int? BatchSize { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Easify.Azure.Serilog/AzureTableStorageOptions.cs b/src/Easify.Azure.Serilog/AzureTableStorageOptions.cs
new file mode 100644
index 0000000..0ef8a12
--- /dev/null
+++ b/src/Easify.Azure.Serilog/AzureTableStorageOptions.cs
@@ -0,0 +1,7 @@
+namespace Easify.Azure.Serilog
+{
+ public sealed class AzureTableStorageOptions
+ {
+ public string ConnectionString { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Easify.Azure.Serilog/Easify.Azure.Serilog.csproj b/src/Easify.Azure.Serilog/Easify.Azure.Serilog.csproj
new file mode 100644
index 0000000..c462c7c
--- /dev/null
+++ b/src/Easify.Azure.Serilog/Easify.Azure.Serilog.csproj
@@ -0,0 +1,20 @@
+
+
+
+ netstandard2.0
+ true
+ Easify.Azure.Serilog
+ Mohammad Moattar
+ https://github.com/icgam/Easify.Azure
+ https://github.com/icgam/Easify.Azure
+ default
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Easify.Azure.Serilog/SinkBuilderContextExtensions.cs b/src/Easify.Azure.Serilog/SinkBuilderContextExtensions.cs
new file mode 100644
index 0000000..eaffd14
--- /dev/null
+++ b/src/Easify.Azure.Serilog/SinkBuilderContextExtensions.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Diagnostics.CodeAnalysis;
+using Easify.Logging.SeriLog;
+using Microsoft.Extensions.Configuration;
+using Serilog;
+
+namespace Easify.Azure.Serilog
+{
+ [ExcludeFromCodeCoverage]
+ public static class SinkBuilderContextExtensions
+ {
+ public static ISinkBuilderContext UseAzureTableStorage(this ISinkBuilderContext sinkBuilderContext, IConfiguration configuration, Action configure = null)
+ {
+ if (configuration == null) throw new ArgumentNullException(nameof(configuration));
+
+ var options = new AzureTableStorageOptions();
+ configuration.GetSection(nameof(AzureTableStorageOptions)).Bind(options);
+ configure?.Invoke(options);
+
+ if (string.IsNullOrWhiteSpace(options.ConnectionString))
+ throw new ArgumentException($"{nameof(options.ConnectionString)} is missing in AzureTableStorageOptions");
+
+ var loggerConfiguration = sinkBuilderContext.LoggerConfiguration.WriteTo.AzureTableStorage(options.ConnectionString);
+
+ return sinkBuilderContext.Clone(loggerConfiguration);
+ }
+
+ public static ISinkBuilderContext UseAzureLogAnalytics(this ISinkBuilderContext sinkBuilderContext, IConfiguration configuration, Action configure = null)
+ {
+ if (configuration == null) throw new ArgumentNullException(nameof(configuration));
+
+ var options = new AzureLogAnalyticsOptions();
+ configuration.GetSection(nameof(AzureLogAnalyticsOptions)).Bind(options);
+ configure?.Invoke(options);
+
+ if (string.IsNullOrWhiteSpace(options.WorkspaceId))
+ throw new ArgumentException($"{nameof(options.WorkspaceId)} is missing in AzureLogAnalyticsOptions");
+
+ if (string.IsNullOrWhiteSpace(options.AuthenticationId))
+ throw new ArgumentException($"{nameof(options.AuthenticationId)} is missing in AzureLogAnalyticsOptions");
+
+ var loggerConfiguration = sinkBuilderContext
+ .LoggerConfiguration
+ .WriteTo
+ .AzureAnalytics(options.WorkspaceId,options.AuthenticationId, logName:options.LogName);
+
+ // TODO: Sanitization of the LogName
+
+ return sinkBuilderContext.Clone(loggerConfiguration);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Easify.Azure.sln b/src/Easify.Azure.sln
index a0bd9fa..6de0b57 100644
--- a/src/Easify.Azure.sln
+++ b/src/Easify.Azure.sln
@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easify.Azure.AspNetCore", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easify.Azure.AspNetCore.UnitTests", "Easify.Azure.AspNetCore.UnitTests\Easify.Azure.AspNetCore.UnitTests.csproj", "{F647B941-F688-4C7F-A45B-5F0AD5772FE1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easify.Azure.Serilog", "Easify.Azure.Serilog\Easify.Azure.Serilog.csproj", "{0DBB081F-8EA1-410D-9340-2D5D5003E657}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +35,10 @@ Global
{F647B941-F688-4C7F-A45B-5F0AD5772FE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F647B941-F688-4C7F-A45B-5F0AD5772FE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F647B941-F688-4C7F-A45B-5F0AD5772FE1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0DBB081F-8EA1-410D-9340-2D5D5003E657}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0DBB081F-8EA1-410D-9340-2D5D5003E657}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0DBB081F-8EA1-410D-9340-2D5D5003E657}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0DBB081F-8EA1-410D-9340-2D5D5003E657}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE