Skip to content

Fixer/Analyzer: Suggest rewriting builder.Host.ConfigureLogging to builder.Logging #35816

@davidfowl

Description

@davidfowl

Simialr to #35815. We should rewrite:

var builder = WebApplication.CreateBuilder(args);

builder.Host.ConfigureLogging(logging =>
{
    logging.AddJsonConsole();
});

// OR

builder.WebHost.ConfigureLogging(logging =>
{
    logging.AddJsonConsole();
});

To:

var builder = WebApplication.CreateBuilder(args);

builder.Logging.AddJsonConsole();

Metadata

Metadata

Labels

Priority:2Work that is important, but not critical for the releaseanalyzerIndicates an issue which is related to analyzer experiencearea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-hostingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions