Huanent.Logging.File 4.0.1

dotnet add package Huanent.Logging.File --version 4.0.1                
NuGet\Install-Package Huanent.Logging.File -Version 4.0.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="Huanent.Logging.File" Version="4.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Huanent.Logging.File --version 4.0.1                
#r "nuget: Huanent.Logging.File, 4.0.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 Huanent.Logging.File as a Cake Addin
#addin nuget:?package=Huanent.Logging.File&version=4.0.1

// Install Huanent.Logging.File as a Cake Tool
#tool nuget:?package=Huanent.Logging.File&version=4.0.1                

Microsoft.Extensions.Logging extensions

Install

Nuget Nuget

Usage

Huanent.Logging.Core

public class ConsoleLogWriter : ILogWriter
{
    public void WriteLog(LogLevel level, string message, string name, Exception exception, EventId eventId)
    {
        Console.WriteLine($"From {nameof(ConsoleLogWriter)} {level} {message} {name} {exception} {eventId}");
    }
}

//ILoggingBuilder
logging.AddImplementation<ConsoleLogWriter>();

Huanent.Logging.File

//ILoggingBuilder
logging.AddFile();

Log will out in {application folder}/logs/20211020.txt

[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:35 +00:00]
Worker running at: 10/20/2021 21:05:35 +08:00
System.Exception: error

[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:36 +00:00]
Worker running at: 10/20/2021 21:05:36 +08:00
System.Exception: error

[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:37 +00:00]
Worker running at: 10/20/2021 21:05:37 +08:00
System.Exception: error
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
4.0.1 171 8/27/2024
4.0.0 119 8/26/2024
3.0.2 985 5/27/2023
3.0.1 1,809 11/27/2021
3.0.0 1,251 10/20/2021