EzLoggerLib 1.0.0.9

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

EzLogger Library

EzLogger is an easy to use logging framework for .NET applications designed to facilitate easy logging and application monitoring with minimal overhead.

Key Features

Comprehensive Logging Levels

Six distinct logging levels (Critical, Error, Warning, Announce, Info, Debug) allow for detailed separation and control over log output, ensuring you receive just the right amount of information.

Console and File Logging

Configurable settings for both console and file outputs, enabling consistent logging to the console and to a log file based on verbosity settings.

Singleton

Singleton architecture guarantees a single, global logger instance per application, making logging easy for small applications which do not need complicated logger interfaces.

Asynchronous Nature

Logs are collected immediately into a queue and are processed in background while the main thread continues. Logs are written in batches to the log file to reduce the amount of write operations, maintaining performance in high-throughput environments.

Automated Log Management

Automatically manages log file sizes with a cleanup mechanism that purges old logs, keeping disk usage in check without manual intervention.

User-friendly Configuration

Straightforward API for configuring verbosity and other settings, making it easy to integrate and customize within your application.

Reliable Operations

Ensures all pending log messages are processed before the application exits, preventing data loss and ensuring operational integrity.

Quick Start Guide

Configuration and Basic Logging

using EzLogger;

// Configure logger to debug level for console output and warning level for file output
Logger.SetConfig(Verbosity.Debug, Verbosity.Warning);

// Logging examples
Logger.Announce("The algorithm has started.");
Logger.Debug("Some event has happened.");
Logger.Info("Application initialized successfully.");
Logger.Warning("Low disk space warning.");
Logger.Error("File read error occurred.");
Logger.Critical("Database connection failure!");

Cleanup and Shutdown

// Clean up and ensure all logs are flushed before application exit
Logger.StopLoggingTasks();

Example

Picture

Installation

Please see the license.

Restrict You License

Copyright (c) 2024 Usman Mehmood. All rights reserved.

Permission is hereby granted to view the code of this
library for educational purposes only.

No permission is granted to download, use, modify,
distribute, or create derivative works from this code
or any part thereof for any other purposes.

Why Choose EzLogger?

EzLogger is dead simple to use. While it may not be as flexible as other more advanced loggers, it provides an easy to use interface and is reasonably performant.

Inner Working

Flowchart

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.