Microsoft.Extensions.Logging.Console 10.0.0-rc.1.25451.107

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

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

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.

Showing the top 20 packages that depend on Microsoft.Extensions.Logging.Console.

Packages Downloads
Elsa.Core
Elsa is a set of workflow libraries and tools that enable super-fast workflowing capabilities in any .NET Core application. This package contains the heart and soul of what makes Elsa tick. It implements most of the abstractions defined in Elsa.Abstractions. If you reference the Elsa package, which is recommended, you don;t have to explicitly reference this package.
31
Elsa.Core
Elsa is a set of workflow libraries and tools that enable super-fast workflowing capabilities in any .NET Core application. This package contains the heart and soul of what makes Elsa tick. It implements most of the abstractions defined in Elsa.Abstractions. If you reference the Elsa package, which is recommended, you don;t have to explicitly reference this package.
32
Microsoft.AspNetCore
Microsoft.AspNetCore
32
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.
32
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/509f6badec2f3162f0e50330cd9107e5624b379b
43
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/a4938d07a5127ffad8466ddf703a6b5b21f4b0c9
37
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
32
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
37
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
212
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
34
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
5,352
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
8,949
nacos-sdk-csharp.Extensions.Configuration
nacos csharp sdk
62
PDFsharp
PDFsharp is the Open Source library for creating and modifying PDF documents using .NET. It has an easy-to-use API that allows developers to generate or modify PDF files programmatically. PDFsharp can be used for various applications, including creating reports, invoices, and other types of documents. This package does not depend on Windows and can be used on any .NET compatible platform including Linux and macOS. See https://docs.pdfsharp.net for details.
31
PDFsharp
PDFsharp is the Open Source library for creating and modifying PDF documents using .NET. It has an easy-to-use API that allows developers to generate or modify PDF files programmatically. PDFsharp can be used for various applications, including creating reports, invoices, and other types of documents. This package does not depend on Windows and can be used on any .NET compatible platform including Linux and macOS. See https://docs.pdfsharp.net for details.
32
PDFsharp
PDFsharp is the Open Source library for creating and modifying PDF documents using .NET. It has an easy-to-use API that allows developers to generate or modify PDF files programmatically. PDFsharp can be used for various applications, including creating reports, invoices, and other types of documents. This package does not depend on Windows and can be used on any .NET compatible platform including Linux and macOS. See https://docs.pdfsharp.net for details.
34
PDFsharp
PDFsharp is the Open Source library for creating and modifying PDF documents using .NET. It has an easy-to-use API that allows developers to generate or modify PDF files programmatically. PDFsharp can be used for various applications, including creating reports, invoices, and other types of documents. This package does not depend on Windows and can be used on any .NET compatible platform including Linux and macOS. See https://docs.pdfsharp.net for details.
35
Pomelo.EntityFrameworkCore.MySql
Package Description
38
Pomelo.EntityFrameworkCore.MySql.Design
Package Description
33
Quantum.FrameworkNetCore
Used for set up Micro-Service.
31

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET Standard 2.0

.NET 10.0

.NET 9.0

.NET 8.0

Version Downloads Last updated
10.0.0-rc.1.25451.107 6 09/12/2025
10.0.0-preview.7.25380.108 5 08/15/2025
10.0.0-preview.6.25358.103 5 07/17/2025
10.0.0-preview.5.25277.114 11 06/10/2025
10.0.0-preview.4.25258.110 11 05/15/2025
10.0.0-preview.3.25171.5 13 04/26/2025
10.0.0-preview.2.25163.2 15 03/30/2025
10.0.0-preview.1.25080.5 13 03/12/2025
9.0.9 4 09/11/2025
9.0.8 5 08/08/2025
9.0.7 8 07/13/2025
9.0.6 9 06/13/2025
9.0.5 14 05/16/2025
9.0.4 11 04/27/2025
9.0.3 16 03/12/2025
9.0.2 16 03/12/2025
9.0.1 20 01/28/2025
9.0.0 29 11/15/2024
9.0.0-rc.2.24473.5 19 11/14/2024
9.0.0-rc.1.24431.7 18 11/28/2024
9.0.0-preview.7.24405.7 17 11/14/2024
9.0.0-preview.6.24327.7 16 11/14/2024
9.0.0-preview.5.24306.7 20 11/12/2024
9.0.0-preview.4.24266.19 26 05/21/2024
9.0.0-preview.3.24172.9 23 05/05/2024
9.0.0-preview.2.24128.5 21 04/28/2024
9.0.0-preview.1.24080.9 26 05/02/2024
8.0.1 27 11/12/2024
8.0.0 213 02/04/2024
8.0.0-rc.2.23479.6 22 05/29/2024
8.0.0-rc.1.23419.4 21 04/30/2024
8.0.0-preview.7.23375.6 26 05/29/2024
8.0.0-preview.6.23329.7 33 08/07/2023
8.0.0-preview.5.23280.8 23 05/15/2024
8.0.0-preview.4.23259.5 23 05/21/2024
8.0.0-preview.3.23174.8 25 05/02/2024
8.0.0-preview.2.23128.3 23 05/02/2024
8.0.0-preview.1.23110.8 28 05/02/2024
7.0.0 48 02/02/2023
7.0.0-rc.2.22472.3 23 05/14/2024
7.0.0-rc.1.22426.10 27 05/04/2024
7.0.0-preview.7.22375.6 18 05/29/2024
7.0.0-preview.6.22324.4 26 04/24/2024
7.0.0-preview.5.22301.12 18 11/28/2024
7.0.0-preview.4.22229.4 25 05/29/2024
7.0.0-preview.3.22175.4 21 05/29/2024
7.0.0-preview.2.22152.2 23 05/29/2024
7.0.0-preview.1.22076.8 18 05/29/2024
6.0.2-mauipre.1.22102.15 21 05/11/2024
6.0.2-mauipre.1.22054.8 17 05/29/2024
6.0.1 23 11/28/2024
6.0.0 60 07/01/2022
6.0.0-rc.2.21480.5 26 05/25/2024
6.0.0-rc.1.21451.13 19 02/09/2023
6.0.0-preview.7.21377.19 18 05/29/2024
6.0.0-preview.6.21352.12 23 05/04/2024
6.0.0-preview.5.21301.5 26 05/19/2024
6.0.0-preview.4.21253.7 20 05/29/2024
6.0.0-preview.3.21201.4 20 05/29/2024
6.0.0-preview.2.21154.6 25 04/30/2024
6.0.0-preview.1.21102.12 17 05/29/2024
5.0.0-rc.2.20475.5 20 05/11/2024
5.0.0-rc.1.20451.14 24 05/20/2024
5.0.0-preview.8.20407.11 21 05/29/2024
5.0.0-preview.7.20364.11 21 05/29/2024
5.0.0-preview.6.20305.6 26 05/01/2024
5.0.0-preview.5.20278.1 24 05/23/2024
5.0.0-preview.4.20251.6 20 05/02/2024
5.0.0-preview.3.20215.2 19 05/25/2024
5.0.0-preview.1.20120.4 26 05/02/2024
3.1.32 8,994 05/12/2023
3.1.31 29 05/17/2024
3.1.30 5,405 11/03/2022
3.1.29 23 05/19/2024
3.1.28 27 05/10/2024
3.1.27 24 05/26/2024
3.1.26 22 05/23/2024
3.1.25 25 05/11/2024
3.1.14 24 05/25/2024
3.1.13 30 02/24/2023
3.1.11 34 05/29/2024
3.1.3 26 05/09/2024
3.1.1 26 05/29/2024
3.1.0-preview3.19553.2 21 11/04/2022
3.1.0-preview2.19525.4 24 05/29/2024
3.1.0-preview1.19506.1 25 05/02/2024
3.0.1 21 05/29/2024
3.0.0-rc1.19456.10 22 05/29/2024
3.0.0-preview5.19227.9 21 05/02/2024
3.0.0-preview3.19153.1 23 05/18/2024
3.0.0-preview.18572.1 19 05/29/2024
2.2.0 28 08/17/2023
2.2.0-preview3-35497 27 05/07/2024
2.2.0-preview2-35157 18 05/25/2024
2.1.0-rc1-final 27 05/13/2024
2.0.0 23 05/11/2024
1.1.2 22 05/06/2024
1.1.0 27 05/29/2024
1.1.0-preview1-final 25 05/14/2024
1.0.0 23 05/02/2024
1.0.0-rc2-final 24 05/02/2024
1.0.0-rc1-final 22 05/02/2024