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
Microsoft.AspNetCore
Microsoft.AspNetCore
66
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.
65
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.
67
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications.
66
Microsoft.AspNetCore.NodeServices
Invoke Node.js modules at runtime in ASP.NET Core applications.
67
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/d1fa2cb155ab9226f20b87ab0d7a1eb16b8a8b69
65
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/fbe05294ac5c88be848b4d57d60cb2657874da9b
65
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
66
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
69
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
66
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
67
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
68
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
69
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
70
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
72

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 4 09/10/2025
10.0.0-preview.7.25380.108 12 08/14/2025
10.0.0-preview.6.25358.103 14 07/16/2025
10.0.0-preview.5.25277.114 25 06/07/2025
10.0.0-preview.4.25258.110 24 05/13/2025
10.0.0-preview.3.25171.5 30 04/14/2025
10.0.0-preview.2.25163.2 32 03/31/2025
10.0.0-preview.1.25080.5 30 04/01/2025
9.0.9 5 09/10/2025
9.0.8 11 08/06/2025
9.0.7 13 07/09/2025
9.0.6 14 06/12/2025
9.0.5 27 05/14/2025
9.0.4 35 04/10/2025
9.0.3 33 03/29/2025
9.0.2 33 03/29/2025
9.0.1 32 03/29/2025
9.0.0 38 11/14/2024
9.0.0-rc.2.24473.5 36 10/20/2024
9.0.0-rc.1.24431.7 31 09/19/2024
9.0.0-preview.7.24405.7 32 08/20/2024
9.0.0-preview.6.24327.7 52 07/18/2024
9.0.0-preview.5.24306.7 49 07/23/2024
9.0.0-preview.4.24266.19 65 07/18/2024
9.0.0-preview.3.24172.9 56 07/23/2024
9.0.0-preview.2.24128.5 63 07/14/2024
9.0.0-preview.1.24080.9 51 07/23/2024
8.0.1 37 10/21/2024
8.0.0 63 04/17/2024
8.0.0-rc.2.23479.6 52 07/22/2024
8.0.0-rc.1.23419.4 54 07/23/2024
8.0.0-preview.7.23375.6 60 07/21/2024
8.0.0-preview.6.23329.7 56 07/23/2024
8.0.0-preview.5.23280.8 52 07/23/2024
8.0.0-preview.4.23259.5 59 07/23/2024
8.0.0-preview.3.23174.8 56 07/23/2024
8.0.0-preview.2.23128.3 58 07/14/2024
8.0.0-preview.1.23110.8 49 07/23/2024
7.0.0 62 07/23/2024
7.0.0-rc.2.22472.3 48 07/23/2024
7.0.0-rc.1.22426.10 55 07/23/2024
7.0.0-preview.7.22375.6 52 07/23/2024
7.0.0-preview.6.22324.4 51 07/23/2024
7.0.0-preview.5.22301.12 52 07/23/2024
7.0.0-preview.4.22229.4 64 07/23/2024
7.0.0-preview.3.22175.4 56 07/23/2024
7.0.0-preview.2.22152.2 54 07/23/2024
7.0.0-preview.1.22076.8 47 07/23/2024
6.0.1 30 11/14/2024
6.0.0 71 07/23/2024
6.0.0-rc.2.21480.5 55 07/23/2024
6.0.0-rc.1.21451.13 51 07/14/2024
6.0.0-preview.7.21377.19 61 07/23/2024
6.0.0-preview.6.21352.12 58 07/23/2024
6.0.0-preview.5.21301.5 59 07/23/2024
6.0.0-preview.4.21253.7 60 07/23/2024
6.0.0-preview.3.21201.4 54 07/14/2024
6.0.0-preview.2.21154.6 53 07/23/2024
6.0.0-preview.1.21102.12 56 07/18/2024
5.0.0 55 07/23/2024
5.0.0-rc.2.20475.5 53 07/23/2024
5.0.0-rc.1.20451.14 51 07/23/2024
5.0.0-preview.8.20407.11 47 07/23/2024
5.0.0-preview.7.20364.11 48 07/23/2024
5.0.0-preview.6.20305.6 52 07/23/2024
5.0.0-preview.5.20278.1 55 07/22/2024
5.0.0-preview.4.20251.6 51 07/23/2024
5.0.0-preview.3.20215.2 60 07/23/2024
5.0.0-preview.2.20160.3 57 07/23/2024
5.0.0-preview.1.20120.4 50 07/23/2024
3.1.32 53 07/23/2024
3.1.31 54 07/23/2024
3.1.30 58 07/23/2024
3.1.29 49 07/23/2024
3.1.28 56 07/23/2024
3.1.27 50 07/23/2024
3.1.26 62 07/18/2024
3.1.25 64 07/22/2024
3.1.24 61 07/23/2024
3.1.23 58 07/21/2024
3.1.22 57 07/23/2024
3.1.21 57 07/23/2024
3.1.20 57 07/23/2024
3.1.19 55 07/23/2024
3.1.18 65 07/23/2024
3.1.17 61 07/23/2024
3.1.16 51 07/23/2024
3.1.15 59 07/23/2024
3.1.14 56 07/22/2024
3.1.13 47 07/23/2024
3.1.12 73 07/23/2024
3.1.11 53 07/17/2024
3.1.10 56 07/22/2024
3.1.9 49 07/23/2024
3.1.8 58 07/23/2024
3.1.7 52 07/23/2024
3.1.6 55 07/23/2024
3.1.5 56 07/23/2024
3.1.4 58 07/23/2024
3.1.3 57 07/23/2024
3.1.2 54 07/23/2024
3.1.1 56 07/23/2024
3.1.0 56 07/23/2024
3.1.0-preview3.19553.2 47 07/23/2024
3.1.0-preview2.19525.4 56 07/23/2024
3.1.0-preview1.19506.1 49 07/23/2024
3.0.3 57 07/23/2024
3.0.2 58 07/23/2024
3.0.1 58 07/14/2024
3.0.0 64 07/22/2024
3.0.0-rc1.19456.10 58 07/23/2024
3.0.0-preview9.19423.4 48 07/23/2024
3.0.0-preview8.19405.4 48 07/23/2024
3.0.0-preview7.19362.4 53 07/23/2024
3.0.0-preview6.19304.6 54 07/22/2024
3.0.0-preview5.19227.9 54 07/23/2024
3.0.0-preview4.19216.2 56 07/23/2024
3.0.0-preview3.19153.1 50 07/23/2024
3.0.0-preview.19074.2 47 07/23/2024
3.0.0-preview.18572.1 51 07/23/2024
2.2.0 66 07/23/2024
2.2.0-preview3-35497 50 07/23/2024
2.2.0-preview2-35157 50 07/18/2024
2.2.0-preview1-35029 43 07/23/2024
2.1.1 58 07/23/2024
2.1.0 51 07/23/2024
2.1.0-rc1-final 53 07/18/2024
2.1.0-preview2-final 56 07/23/2024
2.1.0-preview1-final 51 07/18/2024
2.0.2 54 07/23/2024
2.0.1 55 07/23/2024
2.0.0 60 07/23/2024
2.0.0-preview2-final 53 07/18/2024
2.0.0-preview1-final 51 07/23/2024
1.1.2 62 07/23/2024
1.1.1 61 07/22/2024
1.1.0 60 07/23/2024
1.1.0-preview1-final 58 07/23/2024
1.0.2 59 07/23/2024
1.0.1 50 07/23/2024
1.0.0 59 07/17/2024
1.0.0-rc2-final 61 07/23/2024
1.0.0-rc1-final 48 07/18/2024