-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.dotnet-fundamentals/svcneeds-more-infoNeeds more info from OP. Auto-closed after 2 weeks if no response. [org][resolution]Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution]
Description
Trying to reproduce the example from the page, I noticed that the following code snippet doesn't apply to .NET 7:
public static ILoggingBuilder AddColorConsoleLogger(this ILoggingBuilder builder)
{
builder.AddConfiguration();
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, ColorConsoleLoggerProvider>());
LoggerProviderOptions.RegisterProviderOptions<ColorConsoleLoggerConfiguration, ColorConsoleLoggerProvider>builder.Services);
return builder;
}Reasoning
- There is no extension method adorning the
ILoggingBuilderinterface with a parameterlessAddConfiguration()member:

builder.Servicesdoesn't provide aTryAddEnumerablemethod.- Where does
LoggerProviderOptionsall of a sudden come from?
In addition to these issues, the page is missing an explanation on how to retrieve the configured logging level when it may be defined in Default or the custom logger's dedicated configuration section (https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/#configure-logging)
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: b609eb80-71e8-7a3c-4c4c-60cf9a315cfb
- Version Independent ID: e111baf5-04b7-c497-ce86-eb687e121751
- Content: Implement a custom logging provider - .NET
- Content Source: docs/core/extensions/custom-logging-provider.md
- Product: dotnet-fundamentals
- GitHub Login: @IEvangelist
- Microsoft Alias: dapine
Metadata
Metadata
Assignees
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.dotnet-fundamentals/svcneeds-more-infoNeeds more info from OP. Auto-closed after 2 weeks if no response. [org][resolution]Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution]