Library.NET.Logging 2022.4.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Library.NET.Logging --version 2022.4.5.1                
NuGet\Install-Package Library.NET.Logging -Version 2022.4.5.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="Library.NET.Logging" Version="2022.4.5.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Library.NET.Logging --version 2022.4.5.1                
#r "nuget: Library.NET.Logging, 2022.4.5.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.
// Install Library.NET.Logging as a Cake Addin
#addin nuget:?package=Library.NET.Logging&version=2022.4.5.1

// Install Library.NET.Logging as a Cake Tool
#tool nuget:?package=Library.NET.Logging&version=2022.4.5.1                

Library.NET.Logging

Implementing ICustomLogger

You can use implement ICustomLogger like this:

ICustomLogger logger = new CustomLogger(new FileInfo("logfile.log"), true, LogLevel.Information);

You can then add it to DI as a singleton.

Methods

LogDebug

logger.LogDebug("This is a Debug message");

Output:

[Debug] <4/5/2022 1:42:26 PM> : This is Debug message

LogInformation

logger.LogInformation("This is Information message");

Output:

[Information] <4/5/2022 1:42:26 PM> : This is Information message

LogWarning

logger.LogWarning(new Exception("Test Warning Message"), "This is Warning message");

Output:

[Warning] <4/5/2022 2:04:21 PM> : This is Warning message
        Exception Message:Test Warning Message

LogTrace

logger.LogTrace(new Exception("Test Trace Message", new Exception("Testing the logger system with a test trace message.")), "This is Stacktrace message");

Output:

[Error] <4/5/2022 2:04:21 PM> : This is Stacktrace message
        Exception Message:Test Trace Message
        Inner Message:System.Exception: Testing the logger system with a test trace message.
            Stack Trace:

LogError

logger.LogError(new Exception("Test Error Message", new Exception("Testing the logger system with a test error message.")), "This is Error message");

Output:

[Error] <4/5/2022 2:04:21 PM> : This is Error message
        Exception Message:Test Error Message
        Inner Message:System.Exception: Testing the logger system with a test error message.

LogCritical

logger.LogCritical(new Exception("Test Critical Message", new Exception("Testing the logger system with a test critical message.")), "This is Critical message");

Output:

[Critical] <4/5/2022 2:04:21 PM> : This is Critical message
        Exception Message:Test Critical Message
        Inner Message:System.Exception: Testing the logger system with a test critical message.

Planned implementations

  • None

Outside Dependencies

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

    • No dependencies.

NuGet packages (1)

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

Package Downloads
Library.NET.DataAccess

Data access library package for applications targeting .NET 8.0+ using Dapper as the data access framework

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2023.11.18.1 300 11/18/2023
2022.4.5.1 687 4/5/2022