Skip to content

Commit 89ab799

Browse files
authored
NLogProviderOptions ShutdownOnDispose = true disables LogFactory.AutoShutdown (#565)
1 parent 20f96b5 commit 89ab799

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/NLog.Extensions.Hosting/Extensions/ConfigureExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ private static NLogLoggerProvider CreateNLogLoggerProvider(IServiceProvider serv
7272
TryLoadConfigurationFromContentRootPath(provider.LogFactory, contentRootPath);
7373
}
7474

75+
if (provider.Options.ShutdownOnDispose)
76+
{
77+
provider.LogFactory.AutoShutdown = false;
78+
}
79+
7580
return provider;
7681
}
7782

0 commit comments

Comments
 (0)