Simplifier.Serilog 1.0.4

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

Simplifier For Serilog

Provides simple way to get Serilog Up and running with additional extensions to Serilog API enhancing logging experience.

Enhancements

You get all the features of Serilog + the following

  1. Enriches the logs with additional details, i.e Namespace Name, Class name and Function name.
  2. Enriches the logs enabling applications to measure time consumed by each methods at the instant of logging. (10ms in the example denotes that the function has spend 10ms until it reaches the log statement)
  3. Enriches the logs with In-Out Logs. This allows detailed tracing of each functions enter and exit traces.
  4. Provides various API's to conditionally write the log, reducing complexity in the calling code and log file size.
  5. Zero Setup required as the Logging configuration templates are shipped out of the box

Quick Start

Add the nuget package to your project either via nuget explorer or by running dotnet add package Simplifier.Serilog

The following code will log a single Information Trace in a pre-defined format to MyApplication_YYYYMMDD.slog. The file will be created in the working directory of the executing application.

using (LogScope aScope = new LogScope(new LoggerDetail("DemoUnOptimizedLogger")))
{
    aScope.Info("Hello From Serilogger");
}

However the above example can further be optimized to reuse LoggingDetail and infact one LogScope can be used to log multiple log statements at once. A more realistic example is shown below.

namespace Simplifier.Serilog.Sample
{
    public class DemoClass
    {
        // Declare the logger detail in the class
        private static readonly LoggerDetail myLoggerDetail = new LoggerDetail(typeof(DemoClass));

        public void Execute()
        {
            // Log the required info by creation LogScope withing class methods
            using (LogScope aScope = new LogScope(new LoggerDetail(this.GetType())))
            {
                aScope.Info("Processing execute request for a total of 408 items.");
                // Do Work

                aScope.Warning("Connection returned with busy status, retrying...");

                // Do Work
                aScope.Error("Connection timed out, execute failed");

                // Do Work
                aScope.Fatal("Critical error during execute function.");
            }
        }
    }
}

Runtime Switches

1.LoggingSetup.ChangeLogLevel(); allows the application to change the Log Verbosity at runtime. 1.LoggingSetup.InOutEnabled allows the application to dump IN-OUT traces at runtime.

Default Configuration

The default configuration used LoggingConfiguration.ProdConfig which equates to Informational and higher level logs will be written to MyApplication_.log, which rolls over every day upto 14 days, After which the oldest file will be deleted.

public static LoggingConfiguration ProdConfig => new LoggingConfiguration()
        {
            EnableConsole = false,
            FileName = LoggingSetup.DefaultLogFileName,
            RollingInterval = RollingInterval.Day,
            RetentionFileCountLimit = 14,
            LogFormat = LoggingSetup.DefaultLogFormat,
            LogEventLevel = LogEventLevel.Information,
            MultiProcess = true
        };

Log Format

By default the log file will produce the following columns

Column Number Name Description
1 Date Standard Date Column
2 Time Standard Local Time Column
3 Level 3 Character, Serilog Trace Level.
4 ThreadID ID Of the executing thread
5 Executing Time Time consumed prior to reaching the trace statement.
6 CallSite Namespace + Function Name of the logger
7 Log The full log as written by the application

Customization and Configurations

The library has few preset templates which are present in LoggingConfiguration as static members.

However, library provides allows the consumers to change multiple settings as per the need and this is achieved by invoking LoggingSetup.Create(new LoggingConfiguration() { <Set the Properties as required> });, ensure that this call is made at the startup of the application before any logs are written.

Changelog

1.0.4

  1. Upgrade serilog version to 4.3.1
  2. Fixed bug where Error API was logging at Fatal Level

1.0.3

Added Overloads for all the API's to accept exception object

1.0.2

  1. Added documentation to the nuget package.
  2. Changed Default Log Format to provide 60 Characters for Callsite.

1.0.1

Changed LogScope to class to improve compatibility.

1.0.0

Initial release

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 is compatible.  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 is compatible.  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 is compatible.  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 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 115 3/7/2026
1.0.3 126 2/1/2026
1.0.2 118 1/31/2026
1.0.1 112 1/31/2026
1.0.0 114 1/29/2026

1. Upgrade serilog version to 4.3.1
2. Fixed bug where Error API was logging at Fatal Level