Microsoft.Extensions.Logging.Console 11.0.0-rc.1.26425.128

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
Microsoft.AspNetCore
Microsoft.AspNetCore
37
Microsoft.AspNetCore
Microsoft.AspNetCore
38
Microsoft.AspNetCore
Microsoft.AspNetCore
42
Microsoft.AspNetCore
Microsoft.AspNetCore
44
Microsoft.AspNetCore
Microsoft.AspNetCore
45
Microsoft.AspNetCore
Microsoft.AspNetCore
720
Microsoft.AspNetCore.All
Microsoft.AspNetCore.All
38
Microsoft.AspNetCore.All
Microsoft.AspNetCore.All
39
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.
37
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
38
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
38
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
44
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
66
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
182
PDFsharp-MigraDoc-GDI
MigraDoc is a .NET library that allows developers to create documents such as PDF and RTF using a high-level object model. It provides an intuitive API that simplifies the creation of documents, including text formatting, tables, images, and more. MigraDoc is widely used for generating reports, invoices, and other types of documents in various applications. This package relies on Windows Forms (GDI+) and can be used under Windows only. See https://docs.pdfsharp.net for details.
40

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

.NET 10.0

.NET Standard 2.0

.NET Framework 4.6.2

.NET 11.0

Version Downloads Last updated
11.0.0-rc.1.26425.128 1 09/21/2026
11.0.0-preview.7.26381.103 2 08/15/2026
11.0.0-preview.6.26359.118 3 07/26/2026
11.0.0-preview.5.26302.115 10 06/15/2026
11.0.0-preview.4.26230.115 12 05/23/2026
11.0.0-preview.3.26207.106 11 04/16/2026
11.0.0-preview.2.26159.112 11 03/11/2026
11.0.0-preview.1.26104.118 17 02/12/2026
10.0.12 0 09/08/2026
10.0.11 2 08/15/2026
10.0.10 6 07/26/2026
10.0.9 6 06/15/2026
10.0.8 3 05/26/2026
10.0.7 3 05/06/2026
10.0.6 11 04/16/2026
10.0.5 11 03/14/2026
10.0.4 10 03/11/2026
10.0.3 14 02/12/2026
10.0.2 13 01/15/2026
10.0.1 13 12/11/2025
10.0.0 13 11/13/2025
10.0.0-rc.2.25502.107 12 10/18/2025
10.0.0-rc.1.25451.107 14 09/11/2025
10.0.0-preview.7.25380.108 21 08/14/2025
10.0.0-preview.6.25358.103 21 07/17/2025
10.0.0-preview.5.25277.114 23 06/07/2025
10.0.0-preview.4.25258.110 16 05/16/2025
10.0.0-preview.3.25171.5 23 04/26/2025
10.0.0-preview.2.25163.2 26 03/20/2025
10.0.0-preview.1.25080.5 18 02/25/2025
9.0.20 0 09/08/2026
9.0.19 1 09/16/2026
9.0.18 6 07/26/2026
9.0.17 3 06/15/2026
9.0.16 4 05/26/2026
9.0.15 11 04/16/2026
9.0.14 13 03/11/2026
9.0.13 18 02/12/2026
9.0.12 18 01/15/2026
9.0.11 17 11/13/2025
9.0.10 16 10/18/2025
9.0.9 20 09/11/2025
9.0.8 19 08/07/2025
9.0.7 21 07/12/2025
9.0.6 17 06/14/2025
9.0.5 23 05/16/2025
9.0.4 20 04/26/2025
9.0.3 27 03/20/2025
9.0.2 23 02/19/2025
9.0.1 30 01/18/2025
9.0.0 30 03/05/2025
9.0.0-rc.2.24473.5 23 12/13/2024
9.0.0-rc.1.24431.7 20 01/06/2025
9.0.0-preview.7.24405.7 28 12/07/2024
9.0.0-preview.6.24327.7 29 01/06/2025
9.0.0-preview.5.24306.7 31 12/06/2024
9.0.0-preview.4.24266.19 25 12/29/2024
9.0.0-preview.3.24172.9 26 11/27/2024
9.0.0-preview.2.24128.5 21 04/01/2024
9.0.0-preview.1.24080.9 35 02/15/2024
8.0.1 34 12/15/2024
8.0.0 34 03/07/2024
8.0.0-rc.2.23479.6 31 03/07/2024
8.0.0-rc.1.23419.4 27 03/09/2024
8.0.0-preview.7.23375.6 18 03/09/2024
8.0.0-preview.6.23329.7 27 03/10/2024
8.0.0-preview.5.23280.8 28 03/10/2024
8.0.0-preview.4.23259.5 25 03/10/2024
8.0.0-preview.3.23174.8 32 11/06/2023
8.0.0-preview.2.23128.3 30 11/07/2023
8.0.0-preview.1.23110.8 29 11/14/2023
7.0.0 161 08/18/2023
7.0.0-rc.2.22472.3 38 03/07/2024
7.0.0-rc.1.22426.10 23 11/06/2023
7.0.0-preview.7.22375.6 25 03/09/2024
7.0.0-preview.6.22324.4 29 11/07/2023
7.0.0-preview.5.22301.12 21 03/10/2024
7.0.0-preview.4.22229.4 29 02/28/2024
7.0.0-preview.3.22175.4 27 03/08/2024
7.0.0-preview.2.22152.2 30 11/10/2023
7.0.0-preview.1.22076.8 27 11/11/2023
6.0.2-mauipre.1.22102.15 25 03/18/2024
6.0.2-mauipre.1.22054.8 19 11/12/2023
6.0.1 27 01/18/2025
6.0.0 38 08/18/2023
6.0.0-rc.2.21480.5 23 03/18/2024
6.0.0-rc.1.21451.13 21 03/09/2024
6.0.0-preview.7.21377.19 28 03/09/2024
6.0.0-preview.6.21352.12 28 03/09/2024
6.0.0-preview.5.21301.5 33 03/09/2024
6.0.0-preview.4.21253.7 24 03/09/2024
6.0.0-preview.3.21201.4 25 03/09/2024
6.0.0-preview.2.21154.6 25 03/15/2024
6.0.0-preview.1.21102.12 29 03/08/2024
5.0.0 21 03/07/2024
5.0.0-rc.2.20475.5 31 11/14/2023
5.0.0-rc.1.20451.14 29 03/18/2024
5.0.0-preview.8.20407.11 26 03/17/2024
5.0.0-preview.7.20364.11 21 03/18/2024
5.0.0-preview.6.20305.6 31 11/09/2023
5.0.0-preview.5.20278.1 29 01/18/2025
5.0.0-preview.4.20251.6 23 01/06/2025
5.0.0-preview.3.20215.2 25 11/10/2023
5.0.0-preview.2.20160.3 26 12/16/2024
5.0.0-preview.1.20120.4 28 03/07/2024
3.1.32 24 02/26/2024
3.1.31 34 03/16/2024
3.1.30 21 03/17/2024
3.1.29 31 03/26/2024
3.1.28 36 03/07/2024
3.1.27 26 03/17/2024
3.1.26 21 03/15/2024
3.1.25 33 03/08/2024
3.1.24 25 03/18/2024
3.1.23 28 03/16/2024
3.1.22 41 03/19/2024
3.1.21 29 03/07/2024
3.1.20 21 03/08/2024
3.1.19 34 03/15/2024
3.1.18 30 03/15/2024
3.1.17 34 11/14/2023
3.1.16 24 03/19/2024
3.1.15 24 11/08/2023
3.1.14 27 03/15/2024
3.1.13 29 03/08/2024
3.1.12 29 03/15/2024
3.1.11 28 03/15/2024
3.1.10 31 03/08/2024
3.1.9 32 03/07/2024
3.1.8 26 03/17/2024
3.1.7 27 11/08/2023
3.1.6 39 11/11/2023
3.1.5 20 11/07/2023
3.1.4 27 01/08/2024
3.1.3 35 03/01/2024
3.1.2 33 03/07/2024
3.1.1 27 11/08/2023
3.1.0 29 11/12/2023
3.1.0-preview3.19553.2 23 03/09/2024
3.1.0-preview2.19525.4 36 03/11/2024
3.1.0-preview1.19506.1 30 11/13/2023
3.0.3 32 03/15/2024
3.0.2 24 03/15/2024
3.0.1 27 03/07/2024
3.0.0 38 03/07/2024
3.0.0-rc1.19456.10 29 03/17/2024
3.0.0-preview9.19423.4 35 03/10/2024
3.0.0-preview8.19405.4 25 03/09/2024
3.0.0-preview7.19362.4 25 01/06/2025
3.0.0-preview6.19304.6 24 11/11/2023
3.0.0-preview5.19227.9 28 03/15/2024
3.0.0-preview4.19216.2 28 03/15/2024
3.0.0-preview3.19153.1 23 01/16/2025
3.0.0-preview.19074.2 28 03/11/2024
3.0.0-preview.18572.1 32 03/09/2024
2.2.0 741 08/18/2023
2.2.0-preview3-35497 31 03/10/2024
2.2.0-preview2-35157 33 03/09/2024
2.2.0-preview1-35029 30 03/16/2024
2.1.1 24 03/15/2024
2.1.0 29 03/07/2024
2.1.0-rc1-final 25 11/12/2023
2.1.0-preview2-final 30 03/15/2024
2.1.0-preview1-final 28 03/16/2024
2.0.2 28 03/07/2024
2.0.1 33 11/11/2023
2.0.0 24 03/24/2024
2.0.0-preview2-final 31 11/13/2023
2.0.0-preview1-final 26 11/11/2023
1.1.2 27 03/15/2024
1.1.1 18 01/18/2025
1.1.0 33 03/06/2024
1.1.0-preview1-final 28 11/11/2023
1.0.2 23 11/07/2023
1.0.1 32 03/15/2024
1.0.0 26 03/07/2024
1.0.0-rc2-final 26 03/16/2024
1.0.0-rc1-final 28 03/28/2024