NetTools.Logging 1.2.1

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

NetTools.Logging

NetTools.Logging is a lightweight and standardized .NET logging library that enables multiple logging implementations across applications. By leveraging a centralized Loggers class, developers can register and invoke logging across multiple loggers with ease.

This library is designed to provide extensibility while maintaining simplicity, allowing users to integrate their own logging mechanism by implementing the ILogger interface.


Features

  • Multi-Logger Support: Register multiple loggers to handle different logging methods.
  • Easy Integration: Implement ILogger to create custom loggers that follow a strict design pattern.
  • Flexible Usage: Invoke logging methods across all registered loggers using the central Loggers class.

Getting Started

Installation

To use NetTools.Logging, add the library via NuGet Package Manager:

Install-Package NetTools.Logging

Quick Examples

Adding a Custom Logger

This library itself doesn't do any logging, and is designed to strictly enforce interface logging across multiple loggers. First, you need to create a logger implementing ILogger:

using System;
using NetTools.Logging;

// This is an incredibly simple implementation of the ILogger interface.
public class ConsoleLogger : ILogger
{
    public void Log(params object[] args) => Console.WriteLine($"{string.Join(" ", args)}");
}

Then, add the custom logger to NetTools.Logging.Log loggers:

Log.AddLogger(new ConsoleLogger());
Logging Messages

Once the logger has been registered, you can use the Log class to log messages, this will invoke logging on all added loggers:

Loggers.Log("ERROR", "An error occurred in the system.");
Loggers.Log("User logged in at", DateTime.UtcNow);
Loggers.Log("Service started successfully.");
Loggers.Log("Debugging mode enabled.");

This simple library is used by NetModules.Logging.LocalLogging, a simple, commercially battle tested, NetModules module for logging module messages to local files.

Contributing

We welcome contributions! To get involved:

  1. Fork NetTools.Logging, make improvements, and submit a pull request.
  2. Code will be reviewed upon submission.
  3. Join discussions via the issues board.

License

NetModules is licensed under the MIT License, allowing unrestricted use, modification, and distribution. If you use NetTools.Logging in your own project, we’d love to hear about your experience, and possibly feature you on our website!

Full documentation coming soon!

NetModules Foundation

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.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (1)

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

Package Downloads
NetModules.Logging.LocalLogging

A basic logging module. This module writes any NetModules.LoggingEvent data to the console output where available and also writes logs to a file in the Module.WorkingDirectory path using log rotation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.2 168 5/7/2025
1.2.1 146 5/7/2025
1.2.0 141 5/7/2025