HMoh.Logger2 0.1.0

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

Logger2

Logger2 is a reusable .NET 8 DLL that lets many applications append structured records to one shared binary log file.

Quick start

Reference Logger2.Core.dll or add a project reference to Logger2.Core.csproj, then create a logger with runtime application and component names:

using Logger2.Core;

using var logger = LoggerFactory.Create(
    "BillingService",
    nameof(PaymentProcessor),
    "logger2.config.json");

logger.Info("Payment processing started");
logger.Debug("Gateway request created");
logger.Warn("Gateway response was slow");
logger.Error("Payment failed", exception);
logger.Info("Login attempted with password <secret-value>");
logger.Log(LogLevel.Critical, "Custom severity call");

Every process using the same StorageDirectory and LogFileName writes to that one active file. Logger2 batches queued writes and coordinates processes with a named operating-system mutex.

Text inside angle brackets is automatically encrypted while surrounding text remains readable. The reader restores the original value when IncludeSensitiveText is enabled and the shared password is available.

Outputs

  • Reusable DLL: Logger2.Core/bin/Release/net8.0/Logger2.Core.dll
  • XML API documentation: Logger2.Core/bin/Release/net8.0/Logger2.Core.xml
  • Active log: configured by StorageDirectory + LogFileName
  • Rotated files: ArchiveDirectory
  • Rotation copies: BackupDirectory

See the documentation index and getting-started guide.

Build and test

dotnet build Logger2.sln -c Release -m:1
dotnet run --project Logger2.TestApp

Create a NuGet package

dotnet pack Logger2.Core/Logger2.Core.csproj -c Release

The package and symbol package are written to Logger2.Core/bin/Release. The current package targets net8.0. Choose and add a license before publishing it publicly.

Product Compatible and additional computed target framework versions.
.NET 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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
0.1.0 151 7/12/2026