Maleron.Logging 1.1.2

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

Maleron.Logging

Universal logger for .NET that writes to Console, Trace, and text file with daily rotation and hierarchical directory structure.

Installation

dotnet add package Maleron.Logging

Quick Start

using Maleron.Logging;

// Write with severity levels
Logger.Info("Application started");
Logger.Warning("Disk space low: {0}GB remaining", 2.3);
Logger.Error("Connection failed");

// Log exceptions
Logger.Exception(ex, "Failed to process order");

// Write like Console.WriteLine
Logger.WriteLine("Hello, World!");
Logger.WriteLine(42);
Logger.WriteLine(true);

Configuration

// Change log directory (default: <AppBase>/Logs)
Logger.LogDirectory = @"C:\MyApp\Logs";

// Change directory structure (default: Monthly)
Logger.DirectoryStructure = LogDirectoryStructure.Monthly; // Logs/2026/August/
Logger.DirectoryStructure = LogDirectoryStructure.Yearly;  // Logs/2026/
Logger.DirectoryStructure = LogDirectoryStructure.Daily;   // Logs/2026/August/03/
Logger.DirectoryStructure = LogDirectoryStructure.Flat;    // Logs/

// Change file prefix and extension (default: log.txt)
Logger.LogFilePrefix = "myapp";
Logger.LogFileExtension = "log";

// Enable/disable outputs
Logger.EnableConsole = true;   // Default: true
Logger.EnableTrace = true;     // Default: true
Logger.EnableFile = true;      // Default: true

Timestamps

Logger.TimestampLocality = TimeLocality.Local;  // [2026-08-03 14:30:00]
Logger.TimestampLocality = TimeLocality.UTC;    // [2026-08-03 12:30:00 UTC]
Logger.TimestampLocality = TimeLocality.Both;   // [2026-08-03 14:30:00 / 2026-08-03 12:30:00 UTC]
Logger.TimestampLocality = TimeLocality.None;   // (no timestamp)

Log Levels

Method Level
Logger.Trace(...) Trace
Logger.Info(...) Info
Logger.Warning(...) Warning
Logger.Error(...) Error

Or use the generic method:

Logger.Log(LogLevel.Info, "Message");

File Output

Files are created daily with the pattern {Prefix}_{yyyy-MM-dd}.{Extension}:

Logs/
└── 2026/
    └── August/
        ├── log_2026-08-01.txt
        ├── log_2026-08-02.txt
        └── log_2026-08-03.txt

Clean Old Logs

Logger.CleanOldLogs(daysToKeep: 30);

Thread Safety

All write operations are thread-safe. The logger uses a lock to synchronize writes across Console, Trace, and File outputs.

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
1.1.2 114 8/3/2026