Skip to content

Commit

Permalink
Removed obsolete-attribute from ConfigureNLog-methods for ILoggingBui…
Browse files Browse the repository at this point in the history
…lder. No longer generates double logging.
  • Loading branch information
snakefoot committed Sep 24, 2019
1 parent fa802de commit 951d3a2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/NLog.Web.AspNetCore/AspNetExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ public static IServiceProvider SetupNLogServiceLocator(this IServiceProvider ser
/// <param name="configFileName">Path to NLog configuration file, e.g. nlog.config. </param>
/// >
/// <returns>LogFactory to get loggers, add events etc</returns>
[Obsolete("Use UseNLog() on IWebHostBuilder, and NLog.Web.NLogBuilder.ConfigureNLog()")]
public static LogFactory ConfigureNLog(this ILoggingBuilder builder, string configFileName)
{
ConfigurationItemFactory.Default.RegisterItemsFromAssembly(typeof(AspNetExtensions).GetTypeInfo().Assembly);
builder.AddNLog();
ConfigureServicesNLog(null, builder.Services, serviceProvider => serviceProvider.GetService<IConfiguration>());
return LogManager.LoadConfiguration(configFileName);
}

Expand All @@ -96,11 +94,9 @@ public static LogFactory ConfigureNLog(this ILoggingBuilder builder, string conf
/// <param name="builder">The logging builder</param>
/// <param name="configuration">Config for NLog</param>
/// <returns>LogFactory to get loggers, add events etc</returns>
[Obsolete("Use UseNLog() on IWebHostBuilder, and NLog.Web.NLogBuilder.ConfigureNLog()")]
public static LogFactory ConfigureNLog(this ILoggingBuilder builder, LoggingConfiguration configuration)
{
ConfigurationItemFactory.Default.RegisterItemsFromAssembly(typeof(AspNetExtensions).GetTypeInfo().Assembly);
builder.AddNLog();
ConfigureServicesNLog(null, builder.Services, serviceProvider => serviceProvider.GetService<IConfiguration>());
LogManager.Configuration = configuration;
return LogManager.LogFactory;
}
Expand Down

0 comments on commit 951d3a2

Please sign in to comment.