PlainConsoleLoggerFormatter 5.0.0
dotnet add package PlainConsoleLoggerFormatter --version 5.0.0
NuGet\Install-Package PlainConsoleLoggerFormatter -Version 5.0.0
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="PlainConsoleLoggerFormatter" Version="5.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PlainConsoleLoggerFormatter --version 5.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PlainConsoleLoggerFormatter, 5.0.0"
#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 PlainConsoleLoggerFormatter as a Cake Addin #addin nuget:?package=PlainConsoleLoggerFormatter&version=5.0.0 // Install PlainConsoleLoggerFormatter as a Cake Tool #tool nuget:?package=PlainConsoleLoggerFormatter&version=5.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PlainConsoleLoggerFormatter
A basic alternative console logger formatter for ASP.NET 5.0.
The main differences from the default Microsoft's console formatter are:
- no support for colors
- better log levels mapping (TRACE, DEBUG, INFO, WARN, ERROR and CRIT), instead of weird abbreviations
- log messages are by default on a single line
- exceptions start on a new line and are indented with 4 characters
- the class name is simplified by removing the namespace
Note: custom console formatters were introduced with ASP.NET 5.0. For ASP.NET Core 2/3 refer to the previous versions of this package, which were published as PlainConsoleLogger.
Example message
2018-07-30T22:29:32 INFO [Program] Text message here
The date is in UTC ISO 8601 format.
Usage
- Install with NuGet
- Register the logger through the
ILoggingBuilder
:
private static void ConfigureLogging(HostBuilderContext hostContext, ILoggingBuilder logging)
{
logging.AddConsoleFormatter<PlainConsoleFormatter, PlainConsoleFormatterOptions>();
logging.AddConsole(options => options.FormatterName = nameof(PlainConsoleFormatter));
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- Microsoft.Extensions.Logging.Console (>= 5.0.0)
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 |
---|---|---|
5.0.0 | 3,743 | 11/13/2020 |