Microsoft.Extensions.Logging.Console
                               
                            
                                10.0.0-preview.7.25380.108
                            
                        
                            
                                
                                
                                    Prefix Reserved
                                
                            
                    See the version list below for details.
dotnet add package Microsoft.Extensions.Logging.Console --version 10.0.0-preview.7.25380.108
NuGet\Install-Package Microsoft.Extensions.Logging.Console -Version 10.0.0-preview.7.25380.108
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.0-preview.7.25380.108" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.0-preview.7.25380.108" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
paket add Microsoft.Extensions.Logging.Console --version 10.0.0-preview.7.25380.108
#r "nuget: Microsoft.Extensions.Logging.Console, 10.0.0-preview.7.25380.108"
#:package Microsoft.Extensions.Logging.Console@10.0.0-preview.7.25380.108
#addin nuget:?package=Microsoft.Extensions.Logging.Console&version=10.0.0-preview.7.25380.108&prerelease
#tool nuget:?package=Microsoft.Extensions.Logging.Console&version=10.0.0-preview.7.25380.108&prerelease
About
Microsoft.Extensions.Logging.Console provides a Console logger provider implementation for Microsoft.Extensions.Logging. It provides extension methods for the ILoggingBuilder and ILoggerProviderConfiguration classes.
Key Features
- Allow logging to the console using the Microsoft.Extensions.Logging package.
- Provide extension methods for the ILoggingBuilder and ILoggerProviderConfiguration classes.
How to Use
using System;
using Microsoft.Extensions.Logging;
namespace ConsoleLoggerSample
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create a logger factory with a console provider
            using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
            // 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:
- ConsoleLoggerProvider
- ConsoleLoggerSettings
- ConsoleLoggerOptions
- ConsoleLoggerExtensions
- ConsoleFormatter
- ConsoleFormatterOptions
- JsonConsoleFormatterOptions
- SimpleConsoleFormatterOptions
Additional Documentation
Related Packages
Microsoft.Extensions.Logging.Abstractions Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Debug Microsoft.Extensions.Logging.EventSource Microsoft.Extensions.Logging.EventLog Microsoft.Extensions.Logging.TraceSource
Feedback & Contributing
Microsoft.Extensions.Logging.Console 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 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 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.Bcl.AsyncInterfaces (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Options (>= 10.0.0-preview.7.25380.108)
- System.Buffers (>= 4.6.1)
- System.Text.Json (>= 10.0.0-preview.7.25380.108)
 
- 
                                                    .NETStandard 2.0- Microsoft.Bcl.AsyncInterfaces (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Options (>= 10.0.0-preview.7.25380.108)
- System.Buffers (>= 4.6.1)
- System.Text.Json (>= 10.0.0-preview.7.25380.108)
 
- 
                                                    net10.0- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Options (>= 10.0.0-preview.7.25380.108)
 
- 
                                                    net8.0- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Options (>= 10.0.0-preview.7.25380.108)
- System.Text.Json (>= 10.0.0-preview.7.25380.108)
 
- 
                                                    net9.0- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.7.25380.108)
- Microsoft.Extensions.Options (>= 10.0.0-preview.7.25380.108)
- System.Text.Json (>= 10.0.0-preview.7.25380.108)
 
GitHub repositories (502)
Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Logging.Console:
| Repository | Stars | 
|---|---|
| dotnet/aspnetcore 
                                                            ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
                                                         | |
| microsoft/semantic-kernel 
                                                            Integrate cutting-edge LLM technology quickly and easily into your apps
                                                         | |
| BeyondDimension/SteamTools 
                                                            🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
                                                         | |
| dotnet/maui 
                                                            .NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
                                                         | |
| dotnet/roslyn 
                                                            The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
                                                         | |
| bitwarden/server 
                                                            Bitwarden infrastructure/backend (API, database, Docker, etc).
                                                         | |
| App-vNext/Polly 
                                                            Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.
                                                         | |
| abpframework/abp 
                                                            Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
                                                         | |
| duplicati/duplicati 
                                                            Store securely encrypted backups in the cloud!
                                                         | |
| dotnet/AspNetCore.Docs 
                                                            Documentation for ASP.NET Core
                                                         | |
| microsoft/garnet 
                                                            Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients.
                                                         | |
| chocolatey/choco 
                                                            Chocolatey - the package manager for Windows
                                                         | |
| dotnet/orleans 
                                                            Cloud Native application framework for .NET
                                                         | |
| dodyg/practical-aspnetcore 
                                                            Practical samples of ASP.NET Core 10 RC 2, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
                                                         | |
| HangfireIO/Hangfire 
                                                            An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
                                                         | |
| 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!!
                                                         | |
| dotnet/machinelearning 
                                                            ML.NET is an open source and cross-platform machine learning framework for .NET.
                                                         | |
| JeffreySu/WeiXinMPSDK 
                                                            微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 8.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
                                                         | |
| ThreeMammals/Ocelot 
                                                            .NET API Gateway
                                                         | |
| RayWangQvQ/BiliBiliToolPro 
                                                            B 站(bilibili)自动任务工具,支持docker、青龙、k8s等多种部署方式。敏感肌也能用。
                                                         | 
| 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 | 0 | 9/23/2025 | 
| 9.0.7 | 22 | 7/11/2025 | 
| 3.0.0-preview.19074.2 | 3 | 1/28/2019 | 
| 3.0.0-preview.18572.1 | 2 | 11/30/2018 |