This commit is contained in:
2019-10-22 20:33:18 +00:00
parent 4da7fbee0d
commit bcd050c4c9
7 changed files with 100 additions and 56 deletions

View File

@@ -33,10 +33,10 @@ namespace AyaNova
ServerBootConfig.SetConfiguration(config);
#region Initialize Logging
//NOTE: there is a logging issue that breaks all this with .net 3.1 hostbuilder vs webhostbuilder but webhostbuilder will be deprecated so we need to work around it
//the discussion about that is here: https://github.com/aspnet/AspNetCore/issues/9337
//NOTE: there is a logging issue that breaks all this with .net 3.1 hostbuilder vs webhostbuilder but webhostbuilder will be deprecated so we need to work around it
//the discussion about that is here: https://github.com/aspnet/AspNetCore/issues/9337
//NLOG OFFICIAL GUIDELINES FOR .net core 3.x https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-3
//NLOG OFFICIAL GUIDELINES FOR .net core 3.x https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-3
//default log level
NLog.LogLevel NLogLevel = NLog.LogLevel.Info;
@@ -198,6 +198,12 @@ namespace AyaNova
logger.Fatal(e, "BOOT: E1090 - AyaNova server can't start due to unexpected exception during initialization");
throw;
}
finally
{
// Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
logger.Info("AyaNova server shutting down");
NLog.LogManager.Shutdown();
}
}