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.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,681
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
78
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
56
Microsoft.AspNetCore
Microsoft.AspNetCore
55
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications.
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.Extensions.Hosting
Hosting and startup infrastructures for applications.
51
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
51
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications.
50
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.
49
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications.
49
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/c3acdcac86dad91c3d3fbc3b93ecc6b7ba494bdc
49

.NET 10.0

.NET 11.0

.NET Framework 4.6.2

.NET Standard 2.0

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