Aspnetcore.docs: Migration paths for deprecated ILoggerFactory extension methods

Created on 5 Dec 2018  Â·  1Comment  Â·  Source: dotnet/AspNetCore.Docs

Creating a project targeting ASP.NET Core 1.0 (and possibly others) used to add the following to Configure() method in Startup.cs:

loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();

Those 2 methods are marked as deprecated in ASP.NET Core 2.2. How to properly migrate this?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Source - Docs.ms

Most helpful comment

@jansokoly You can safely remove these 2 lines of code. As of ASP.NET Core 2.0, this code runs when calling CreateDefaultBuilder from Program.Main. See https://github.com/aspnet/MetaPackages/blob/586d641934e997045ed98b1978684a7b0c607b39/src/Microsoft.AspNetCore/WebHost.cs#L182-L184.

>All comments

@jansokoly You can safely remove these 2 lines of code. As of ASP.NET Core 2.0, this code runs when calling CreateDefaultBuilder from Program.Main. See https://github.com/aspnet/MetaPackages/blob/586d641934e997045ed98b1978684a7b0c607b39/src/Microsoft.AspNetCore/WebHost.cs#L182-L184.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

serpent5 picture serpent5  Â·  3Comments

AnthonyMastrean picture AnthonyMastrean  Â·  3Comments

royshouvik picture royshouvik  Â·  3Comments

Rick-Anderson picture Rick-Anderson  Â·  3Comments

YeyoCoder picture YeyoCoder  Â·  3Comments