Common.Logging.Serilog 5.1.0

dotnet add package Common.Logging.Serilog --version 5.1.0
                    
NuGet\Install-Package Common.Logging.Serilog -Version 5.1.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="Common.Logging.Serilog" Version="5.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Common.Logging.Serilog" Version="5.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Common.Logging.Serilog" />
                    
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 Common.Logging.Serilog --version 5.1.0
                    
#r "nuget: Common.Logging.Serilog, 5.1.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.
#addin nuget:?package=Common.Logging.Serilog&version=5.1.0
                    
Install Common.Logging.Serilog as a Cake Addin
#tool nuget:?package=Common.Logging.Serilog&version=5.1.0
                    
Install Common.Logging.Serilog as a Cake Tool

Common.Logging.Serilog

NuGet version Build and Push to Nuget

Common.Logging.Serilog is an adapter that bridges the Common.Logging abstraction with Serilog, allowing you to use Serilog as the underlying logging framework in applications that rely on Common.Logging.

Installation

Install the package via NuGet Package Manager:

Install-Package Common.Logging.Serilog

Or using the .NET CLI:

dotnet add package Common.Logging.Serilog

Getting Started

Configuring Common.Logging

Update your app.config or web.config file to use the Serilog factory adapter:

<configuration>
  <configSections>
    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
    </sectionGroup>
  </configSections>

  <common>
    <logging>
      <factoryAdapter type="Common.Logging.Serilog.SerilogFactoryAdapter, Common.Logging.Serilog" />
    </logging>
  </common>
</configuration>

Setting Up Serilog & Usage Example

Configure Serilog and assign it to the global Log.Logger instance:

using Serilog;
using Common.Logging;

class Program
{
    static void Main(string[] args)
    {
        // Configure Serilog: -- Must set global Log.Logger instance
        Log.Logger = new LoggerConfiguration()
            .WriteTo.Console()
            .CreateLogger();

        // Obtain a Common.Logging logger
        var logger = LogManager.GetLogger<Program>();
        logger.Info("Application has started.");

        // Your application code here

        // Ensure to flush and close Serilog at the end
        Log.CloseAndFlush();
    }
}

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.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 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Common.Logging.Serilog:

Package Downloads
Texnomic.SecureDNS.Core

Texnomic SecureDNS Core Library.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Common.Logging.Serilog:

Repository Stars
Texnomic/SecureDNS
Secure, Modern, Fully-Featured, All-In-One Cross-Architecture & Cross-Platform DNS Server Using .NET 8.0
mellowagain/Titan
A free, advanced CS:GO report and commendation bot built with performance and ease-of-use in mind
Version Downloads Last updated
5.1.0 70 3/29/2025
5.0.1 20,969 9/20/2024
5.0.0 136 9/20/2024
4.4.0 2,128,340 4/1/2020
4.3.6 441,920 3/22/2018
4.3.4 6,857 3/4/2018
4.3.0 39,851 8/9/2017
4.1.11 82,379 2/6/2017
4.1.9 1,492 2/1/2017
4.1.2 12,588 7/11/2016
4.1.1 1,548 7/8/2016
3.1.6 3,903 5/9/2016
3.1.5 8,216 9/9/2015
3.1.3 1,274 9/9/2015
3.1.1 3,098 4/11/2015
3.0.1 1,773 1/13/2015
2.3.6 1,447 1/8/2015
2.3.5 1,239 1/8/2015
2.2.5 3,782 11/24/2014
2.1.0 3,493 10/1/2014
2.0.0 1,325 9/30/2014
1.2.0 1,588 7/4/2014
1.1.0 1,652 5/1/2014
1.0.0 2,202 7/25/2013

v5.1.0 - Targetting .NET 4.6.2. Using Version instead of PackageVersion so assembly version matches.