Microsoft.Extensions.Logging.Debug 9.0.6 (original) (raw)

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

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:

Additional Documentation

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 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.

NuGet packages (659)

Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Logging.Debug:

Package Downloads
Microsoft.Extensions.Hosting Hosting and startup infrastructures for applications. 873.5M
Microsoft.AspNetCore.Hosting ASP.NET Core hosting infrastructure and startup logic for web applications. 606.6M
Microsoft.AspNetCore Microsoft.AspNetCore 161.5M
Microsoft.AspNetCore.App Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download. 38.6M
Microsoft.AspNetCore.All Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download. 35.1M

GitHub repositories (424)

Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Logging.Debug:

Repository Stars
DevToys-app/DevToys A Swiss Army knife for developers. 29.0K
microsoft/semantic-kernel Integrate cutting-edge LLM technology quickly and easily into your apps 25.0K
dotnet/maui .NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop. 22.7K
dotnet/AspNetCore.Docs Documentation for ASP.NET Core 12.9K
chocolatey/choco Chocolatey - the package manager for Windows 10.8K
unoplatform/uno Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!! 9.4K
JeffreySu/WeiXinMPSDK 微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 8.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#. 8.7K
ThreeMammals/Ocelot .NET API Gateway 8.6K
dotnet/eShop A reference .NET application implementing an eCommerce site 8.2K
microsoft/ailab Experience, Learn and Code the latest breakthrough innovations with Microsoft AI 7.8K
louthy/language-ext C# pure functional programming framework - come and get declarative! 6.8K
microsoft/FASTER Fast persistent recoverable log and key-value store + cache, in C# and C++. 6.4K
ScottPlot/ScottPlot Interactive plotting library for .NET 5.9K
danielgerlag/workflow-core Lightweight workflow engine for .NET Standard 5.6K
aspnet/Mvc [Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore 5.6K
anjoy8/Blog.Core 💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档: 5.2K
jasontaylordev/NorthwindTraders Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core. 5.0K
mono/SkiaSharp SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images. 4.9K
umbraco/Umbraco-CMS Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences. 4.9K
openiddict/openiddict-core Flexible and versatile OAuth 2.0/OpenID Connect stack for .NET 4.8K
Version Downloads Last updated
10.0.0-preview.5.25277.114 3,070 6/6/2025
10.0.0-preview.4.25258.110 14,597 5/12/2025
10.0.0-preview.3.25171.5 24,091 4/10/2025
10.0.0-preview.2.25163.2 15,397 3/18/2025
10.0.0-preview.1.25080.5 13,899 2/25/2025
9.0.6 160,315 6/10/2025
9.0.5 1,845,678 5/13/2025
9.0.4 3,812,002 4/8/2025
9.0.3 3,528,167 3/11/2025
9.0.2 4,431,118 2/11/2025
9.0.1 4,389,562 1/14/2025
9.0.0 11,601,757 11/12/2024
9.0.0-rc.2.24473.5 120,871 10/8/2024
9.0.0-rc.1.24431.7 87,862 9/10/2024
9.0.0-preview.7.24405.7 44,667 8/13/2024
9.0.0-preview.6.24327.7 49,050 7/9/2024
9.0.0-preview.5.24306.7 31,018 6/11/2024
9.0.0-preview.4.24266.19 29,124 5/21/2024
9.0.0-preview.3.24172.9 112,838 4/11/2024
9.0.0-preview.2.24128.5 33,440 3/12/2024
9.0.0-preview.1.24080.9 58,559 2/13/2024
8.0.1 41,650,393 10/8/2024
8.0.0 109,027,977 11/14/2023
8.0.0-rc.2.23479.6 181,315 10/10/2023
8.0.0-rc.1.23419.4 142,402 9/12/2023
8.0.0-preview.7.23375.6 60,699 8/8/2023
8.0.0-preview.6.23329.7 78,230 7/11/2023
8.0.0-preview.5.23280.8 62,824 6/13/2023
8.0.0-preview.4.23259.5 292,946 5/16/2023
8.0.0-preview.3.23174.8 110,346 4/11/2023
8.0.0-preview.2.23128.3 33,465 3/14/2023
8.0.0-preview.1.23110.8 94,261 2/21/2023
7.0.0 79,240,723 11/7/2022
7.0.0-rc.2.22472.3 158,298 10/11/2022
7.0.0-rc.1.22426.10 88,638 9/14/2022
7.0.0-preview.7.22375.6 58,431 8/9/2022
7.0.0-preview.6.22324.4 49,117 7/12/2022
7.0.0-preview.5.22301.12 43,880 6/14/2022
7.0.0-preview.4.22229.4 52,124 5/10/2022
7.0.0-preview.3.22175.4 47,811 4/13/2022
7.0.0-preview.2.22152.2 15,096 3/14/2022
7.0.0-preview.1.22076.8 26,132 2/17/2022
6.0.1 103,253 11/12/2024
6.0.0 190,884,003 11/8/2021
6.0.0-rc.2.21480.5 378,446 10/12/2021
6.0.0-rc.1.21451.13 266,897 9/14/2021
6.0.0-preview.7.21377.19 130,539 8/10/2021
6.0.0-preview.6.21352.12 46,248 7/14/2021
6.0.0-preview.5.21301.5 30,437 6/15/2021
6.0.0-preview.4.21253.7 21,944 5/24/2021
6.0.0-preview.3.21201.4 37,405 4/8/2021
6.0.0-preview.2.21154.6 81,086 3/11/2021 6.0.0-preview.2.21154.6 is deprecated because it is no longer maintained.
6.0.0-preview.1.21102.12 37,483 2/12/2021 6.0.0-preview.1.21102.12 is deprecated because it is no longer maintained.
5.0.0 115,483,490 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.5 100,988 10/13/2020 5.0.0-rc.2.20475.5 is deprecated because it is no longer maintained.
5.0.0-rc.1.20451.14 50,010 9/14/2020 5.0.0-rc.1.20451.14 is deprecated because it is no longer maintained.
5.0.0-preview.8.20407.11 32,332 8/25/2020 5.0.0-preview.8.20407.11 is deprecated because it is no longer maintained.
5.0.0-preview.7.20364.11 34,929 7/21/2020 5.0.0-preview.7.20364.11 is deprecated because it is no longer maintained.
5.0.0-preview.6.20305.6 24,810 6/25/2020 5.0.0-preview.6.20305.6 is deprecated because it is no longer maintained.
5.0.0-preview.5.20278.1 12,585 6/10/2020 5.0.0-preview.5.20278.1 is deprecated because it is no longer maintained.
5.0.0-preview.4.20251.6 28,388 5/18/2020 5.0.0-preview.4.20251.6 is deprecated because it is no longer maintained.
5.0.0-preview.3.20215.2 17,319 4/23/2020 5.0.0-preview.3.20215.2 is deprecated because it is no longer maintained.
5.0.0-preview.2.20160.3 125,238 4/2/2020 5.0.0-preview.2.20160.3 is deprecated because it is no longer maintained.
5.0.0-preview.1.20120.4 27,801 3/16/2020 5.0.0-preview.1.20120.4 is deprecated because it is no longer maintained.
3.1.32 2,424,134 12/13/2022
3.1.31 570,527 11/8/2022
3.1.30 1,109,674 10/11/2022
3.1.29 339,801 9/13/2022
3.1.28 488,357 8/9/2022
3.1.27 351,300 7/12/2022
3.1.26 320,635 6/14/2022
3.1.25 442,997 5/10/2022
3.1.24 371,417 4/11/2022
3.1.23 785,941 3/8/2022
3.1.22 9,674,023 12/14/2021
3.1.21 1,624,923 11/7/2021
3.1.20 843,915 10/11/2021
3.1.19 863,593 9/14/2021
3.1.18 1,936,408 8/10/2021
3.1.17 1,337,143 7/13/2021
3.1.16 1,769,633 6/8/2021
3.1.15 2,510,158 5/11/2021
3.1.14 2,350,390 4/6/2021
3.1.13 2,488,529 3/9/2021
3.1.12 2,457,775 2/9/2021
3.1.11 2,717,228 1/12/2021
3.1.10 6,252,758 11/9/2020
3.1.9 8,322,664 10/13/2020
3.1.8 10,829,701 9/8/2020
3.1.7 7,169,079 8/11/2020
3.1.6 10,035,115 7/14/2020
3.1.5 11,261,235 6/9/2020
3.1.4 7,457,356 5/12/2020
3.1.3 11,810,517 3/24/2020
3.1.2 10,719,383 2/18/2020
3.1.1 10,023,128 1/14/2020
3.1.0 23,691,232 12/3/2019
3.1.0-preview3.19553.2 35,767 11/13/2019 3.1.0-preview3.19553.2 is deprecated because it is no longer maintained.
3.1.0-preview2.19525.4 31,238 11/1/2019 3.1.0-preview2.19525.4 is deprecated because it is no longer maintained.
3.1.0-preview1.19506.1 930,931 10/15/2019 3.1.0-preview1.19506.1 is deprecated because it is no longer maintained.
3.0.3 262,811 2/18/2020 3.0.3 is deprecated because it is no longer maintained.
3.0.2 739,796 1/14/2020 3.0.2 is deprecated because it is no longer maintained.
3.0.1 1,372,344 11/18/2019 3.0.1 is deprecated because it is no longer maintained.
3.0.0 19,403,511 9/23/2019 3.0.0 is deprecated because it is no longer maintained.
3.0.0-rc1.19456.10 27,863 9/16/2019 3.0.0-rc1.19456.10 is deprecated because it is no longer maintained.
3.0.0-preview9.19423.4 49,954 9/4/2019 3.0.0-preview9.19423.4 is deprecated because it is no longer maintained.
3.0.0-preview8.19405.4 85,079 8/13/2019 3.0.0-preview8.19405.4 is deprecated because it is no longer maintained.
3.0.0-preview7.19362.4 53,115 7/23/2019 3.0.0-preview7.19362.4 is deprecated because it is no longer maintained.
3.0.0-preview6.19304.6 60,304 6/12/2019 3.0.0-preview6.19304.6 is deprecated because it is no longer maintained.
3.0.0-preview5.19227.9 82,749 5/6/2019 3.0.0-preview5.19227.9 is deprecated because it is no longer maintained.
3.0.0-preview4.19216.2 11,359 4/18/2019 3.0.0-preview4.19216.2 is deprecated because it is no longer maintained.
3.0.0-preview3.19153.1 44,798 3/6/2019 3.0.0-preview3.19153.1 is deprecated because it is no longer maintained.
3.0.0-preview.19074.2 86,886 1/29/2019 3.0.0-preview.19074.2 is deprecated because it is no longer maintained.
3.0.0-preview.18572.1 3,371 12/4/2018 3.0.0-preview.18572.1 is deprecated because it is no longer maintained.
2.2.0 69,524,882 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 90,606 10/17/2018 2.2.0-preview3-35497 is deprecated because it is no longer maintained.
2.2.0-preview2-35157 26,057 9/12/2018 2.2.0-preview2-35157 is deprecated because it is no longer maintained.
2.2.0-preview1-35029 20,054 8/22/2018 2.2.0-preview1-35029 is deprecated because it is no longer maintained.
2.1.1 36,154,399 6/18/2018
2.1.0 8,511,944 5/29/2018
2.1.0-rc1-final 59,546 5/6/2018 2.1.0-rc1-final is deprecated because it is no longer maintained.
2.1.0-preview2-final 38,965 4/10/2018 2.1.0-preview2-final is deprecated because it is no longer maintained.
2.1.0-preview1-final 118,035 2/26/2018 2.1.0-preview1-final is deprecated because it is no longer maintained.
2.0.2 5,392,439 5/7/2018 2.0.2 is deprecated because it is no longer maintained.
2.0.1 6,482,514 3/13/2018 2.0.1 is deprecated because it is no longer maintained.
2.0.0 27,037,765 8/11/2017 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview2-final 88,246 6/28/2017 2.0.0-preview2-final is deprecated because it is no longer maintained.
2.0.0-preview1-final 53,299 5/10/2017 2.0.0-preview1-final is deprecated because it is no longer maintained.
1.1.2 2,476,175 5/9/2017 1.1.2 is deprecated because it is no longer maintained.
1.1.1 2,284,263 3/6/2017 1.1.1 is deprecated because it is no longer maintained.
1.1.0 1,108,321 11/16/2016 1.1.0 is deprecated because it is no longer maintained.
1.1.0-preview1-final 12,354 10/24/2016 1.1.0-preview1-final is deprecated because it is no longer maintained.
1.0.2 1,378,038 3/6/2017 1.0.2 is deprecated because it is no longer maintained.
1.0.1 492,820 12/12/2016 1.0.1 is deprecated because it is no longer maintained.
1.0.0 2,993,115 6/27/2016 1.0.0 is deprecated because it is no longer maintained.
1.0.0-rc2-final 71,232 5/16/2016 1.0.0-rc2-final is deprecated because it is no longer maintained.
1.0.0-rc1-final 279,756 11/18/2015 1.0.0-rc1-final is deprecated because it is no longer maintained.