Skip to content

Commit

Permalink
IHostingEnvironment is obsolete in NetCore3. Instead use ILoggingBuil…
Browse files Browse the repository at this point in the history
…der.ConfigureNLog (#478)
  • Loading branch information
snakefoot authored and 304NotModified committed Sep 24, 2019
1 parent 1ddecc0 commit fa802de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/NLog.Web.AspNetCore/AspNetExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static class AspNetExtensions
/// </summary>
/// <param name="app"></param>
#if ASP_NET_CORE2
[Obsolete("Use UseNLog() on IWebHostBuilder")]
[Obsolete("Use UseNLog() on IWebHostBuilder / IHostBuilder")]
#endif
public static void AddNLogWeb(this IApplicationBuilder app)
{
Expand All @@ -41,6 +41,9 @@ public static void AddNLogWeb(this IApplicationBuilder app)
/// <param name="env"></param>
/// <param name="configFileRelativePath">relative path to NLog configuration file.</param>
/// <returns>LoggingConfiguration for chaining</returns>
#if ASP_NET_CORE2
[Obsolete("Use ConfigureNLog() on ILoggingBuilder. Or UseNLog() on IWebHostBuilder / IHostBuilder")]
#endif
public static LoggingConfiguration ConfigureNLog(this IHostingEnvironment env, string configFileRelativePath)
{
ConfigurationItemFactory.Default.RegisterItemsFromAssembly(typeof(AspNetExtensions).GetTypeInfo().Assembly);
Expand Down

0 comments on commit fa802de

Please sign in to comment.