private static void SetupTerminationEvents()
{
try
{
CurrentAppDomain.ProcessExit += LogManager_OnStopLogging;
CurrentAppDomain.DomainUnload += LogManager_OnStopLogging;
}
catch (Exception exception)
{
InternalLogger.Warn(exception, "Error setting up termination events.");
if (exception.MustBeRethrown())
{
throw;
}
}
}
#endif