Use LoggerFactory.Create(...) instead of new LoggerFactory()

Proprietary

Rewrites the obsolete new LoggerFactory() plus ILoggerFactory.Add*() provider configuration to LoggerFactory.Create(builder => ...), moving each provider registration onto the ILoggingBuilder. Handles both the chained form and the form where registration calls follow the declaration as separate statements. Argument shapes with no ILoggingBuilder equivalent are left in place and flagged for manual migration.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.UseLoggerFactoryCreate
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.AspNetCore3.UseLoggerFactoryCreate

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.