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

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.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,747
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
84
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications.
56
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
56
Microsoft.AspNetCore
Microsoft.AspNetCore
55
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
54
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
54
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
53
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/8ca3954ca335343ce6dd1d14d8d1c6c3369710b7
53
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
53
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/c5f85986e62dabfc0b7f2f2a45dc7c22e8ac815f
53
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
52
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
50
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.
50
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications.
50
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
50

.NET 10.0

.NET 11.0

.NET Framework 4.6.2

.NET Standard 2.0

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