ConsoleMonster.Extensions.Logging 2.1.2

dotnet add package ConsoleMonster.Extensions.Logging --version 2.1.2
                    
NuGet\Install-Package ConsoleMonster.Extensions.Logging -Version 2.1.2
                    
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="ConsoleMonster.Extensions.Logging" Version="2.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConsoleMonster.Extensions.Logging" Version="2.1.2" />
                    
Directory.Packages.props
<PackageReference Include="ConsoleMonster.Extensions.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 ConsoleMonster.Extensions.Logging --version 2.1.2
                    
#r "nuget: ConsoleMonster.Extensions.Logging, 2.1.2"
                    
#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 ConsoleMonster.Extensions.Logging@2.1.2
                    
#: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=ConsoleMonster.Extensions.Logging&version=2.1.2
                    
Install as a Cake Addin
#tool nuget:?package=ConsoleMonster.Extensions.Logging&version=2.1.2
                    
Install as a Cake Tool

ConsoleMonster.Extensions.Logging

A Microsoft.Extensions.Logging provider that writes log entries the ConsoleMonster way. It depends only on Microsoft.Extensions.Logging.Abstractions and ConsoleMonster.

dotnet add package ConsoleMonster.Extensions.Logging
using ConsoleMonster.Extensions.Logging;
using Microsoft.Extensions.Logging;

using ILoggerFactory factory = LoggerFactory.Create(logging => logging.AddConsoleMonster());
ILogger log = factory.CreateLogger("Shop.Orders");

using (log.BeginScope("order {Id}", 1042)) {
    log.LogInformation("Payment accepted");
    log.LogWarning("Stock is low for {Sku}", "A-17");
}
14:05:12        Orders (order 1042)  Payment accepted
14:05:12 ▴ WARN Orders (order 1042)  Stock is low for A-17

What it does

  • Each entry gets the level tag and colour that Write-ConsoleLogEntry and the dashboard log region use:
    • ✗ ERR for Error and Critical;
    • ▴ WARN for Warning;
    • DBG and VERB for Debug and Trace, with the text muted;
    • no tag for Information.
  • A timestamp comes first (TimestampFormat, default HH:mm:ss; null leaves it out; UseUtcTimestamp).
  • Then the category: the last part by default, Full, or None. Scopes follow in brackets (IncludeScopes).
  • The event id is shown only when asked for (IncludeEventId).
  • An exception's type and message print under the entry, with up to MaxExceptionLines lines of details. While a dashboard shows, such entries print above it rather than into its log, so the details stay in the scrollback.
  • While a live session with a log region runs, such as a ConsoleMonster dashboard or ConsoleMonster.Hosting's AddConsoleDashboard, entries go into that region (LogRegion, default $log), so they never print over the view.
  • With output redirected (CI, a file, a pipe), entries are plain lines without escape codes. Colours and glyphs follow the terminal, as everywhere in ConsoleMonster.

Options

Option Default Meaning
MinimumLevel Trace The lowest level written; the logging builder's filters apply first.
TimestampFormat HH:mm:ss A .NET date format, or null for no timestamp.
UseUtcTimestamp false UTC instead of local time.
Category Short Short, Full or None.
IncludeScopes true Shows the scopes after the category.
IncludeEventId false Shows the event id.
MaxExceptionLines 12 Lines of exception details; 0 for the type and message only.
LogRegion $log The live log region to write into while one runs; null always prints.
Profile, Writer current terminal Where and for which terminal lines are written (tests, files).

The provider is added once: a second AddConsoleMonster keeps the first call's options. Without dependency injection, use loggerFactory.AddConsoleMonster(). The provider is thread-safe and works with trimming and native AOT on .NET 8 and later.

Logging · Hosting dashboard · ConsoleMonster

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 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.  net10.0 is compatible.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.

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
2.1.2 69 10/29/2026
2.1.1 67 10/29/2026
2.1.0 71 10/28/2026