Microsoft.Extensions.Logging.Debug
9.0.10
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.Extensions.Logging.Debug --version 9.0.10
NuGet\Install-Package Microsoft.Extensions.Logging.Debug -Version 9.0.10
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" />
paket add Microsoft.Extensions.Logging.Debug --version 9.0.10
#r "nuget: Microsoft.Extensions.Logging.Debug, 9.0.10"
#:package Microsoft.Extensions.Logging.Debug@9.0.10
#addin nuget:?package=Microsoft.Extensions.Logging.Debug&version=9.0.10
#tool nuget:?package=Microsoft.Extensions.Logging.Debug&version=9.0.10
About
Microsoft.Extensions.Logging.Debug provides a Debug output logger provider implementation for Microsoft.Extensions.Logging. This logger logs messages to a debugger monitor by writing messages with System.Diagnostics.Debug.WriteLine().
Key Features
- Allow logging to the debugger output.
- Provide extensions method for the ILoggingBuilder class to easily enable this Debug logger.
How to Use
using System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Debug;
namespace DebugLoggerSample
{
class Program
{
static void Main(string[] args)
{
// Create a logger factory with a debug provider
using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddDebug());
// Create a logger with the category name of the current class
ILogger<Program> logger = loggerFactory.CreateLogger<Program>();
// Log some messages with different log levels and message templates
logger.LogTrace("This is a trace message.");
logger.LogDebug("This is a debug message.");
logger.LogInformation("Hello {Name}!", "World");
logger.LogWarning("This is a warning message.");
logger.LogError("This is an error message.");
logger.LogCritical("This is a critical message.");
// Use structured logging to capture complex data
var person = new Person { Name = "Alice", Age = 25 };
logger.LogInformation("Created a new person: {@Person}", person);
// Use exception logging to capture the details of an exception
try
{
throw new Exception("Something went wrong.");
}
catch (Exception ex)
{
logger.LogError(ex, "An exception occurred.");
}
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
// A simple class to demonstrate structured logging
class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
}
Main Types
The main types provided by this library are:
DebugLoggerProviderDebugLoggerFactoryExtensions
Additional Documentation
Related Packages
Microsoft.Extensions.Logging.Abstractions Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Console Microsoft.Extensions.Logging.EventSource Microsoft.Extensions.Logging.EventLog Microsoft.Extensions.Logging.TraceSource
Feedback & Contributing
Microsoft.Extensions.Logging.Debug is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions 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 is compatible. 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 was computed. 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 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. 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. |
-
.NETFramework 4.6.2
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Logging (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Logging (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Logging (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Logging (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0-rc.2.25466.103 | 0 | 9/22/2025 |
| 10.0.0-rc.1.25451.107 | 0 | 9/22/2025 |
| 10.0.0-rc.1.25421.113 | 0 | 8/28/2025 |
| 10.0.0-preview.7.25380.108 | 0 | 8/11/2025 |
| 10.0.0-preview.7.25380.105 | 0 | 8/6/2025 |
| 10.0.0-preview.6.25358.103 | 0 | 7/17/2025 |
| 10.0.0-preview.6.25321.102 | 0 | 6/25/2025 |
| 10.0.0-preview.5.25280.105 | 0 | 6/2/2025 |
| 10.0.0-preview.5.25277.114 | 0 | 6/3/2025 |
| 10.0.0-preview.5.25277.101 | 0 | 5/29/2025 |
| 10.0.0-preview.5.25266.103 | 0 | 5/20/2025 |
| 10.0.0-preview.4.25255.103 | 0 | 5/12/2025 |
| 9.0.10 | 1 | 9/23/2025 |
| 9.0.7 | 28 | 7/11/2025 |
| 3.0.0-preview.19074.2 | 2 | 1/28/2019 |
| 3.0.0-preview.18572.1 | 2 | 11/30/2018 |