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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Microsoft.Extensions.Logging extensions
Install
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 | Versions 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.
-
net8.0
- Huanent.Logging.Core (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.