Disable Event Log; it is causing occasional service crashes (#145)
This commit is contained in:
Родитель
0befe3ef01
Коммит
c490afed06
|
@ -18,7 +18,6 @@ using Microsoft.Extensions.DependencyInjection;
|
|||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Hosting.WindowsServices;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.EventLog;
|
||||
using Microsoft.FactoryOrchestrator.Client;
|
||||
using Microsoft.FactoryOrchestrator.Core;
|
||||
using Microsoft.FactoryOrchestrator.Server;
|
||||
|
@ -129,21 +128,9 @@ namespace Microsoft.FactoryOrchestrator.Service
|
|||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && isService)
|
||||
{
|
||||
hostBuilder.UseContentRoot(AppContext.BaseDirectory);
|
||||
hostBuilder.ConfigureLogging((hostingContext, logging) =>
|
||||
{
|
||||
logging.AddEventLog();
|
||||
logging.SetMinimumLevel(_logLevel);
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
hostBuilder.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.AddSingleton<IHostLifetime, WindowsServiceLifetime>();
|
||||
services.Configure<EventLogSettings>(settings =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(settings.SourceName))
|
||||
{
|
||||
settings.SourceName = hostContext.HostingEnvironment.ApplicationName;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче