Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #148 from Particular/hotfix-6.0.2
Browse files Browse the repository at this point in the history
Defer logger creation to allow custom logging configuration for Host 6.*
  • Loading branch information
seanfarmar authored Feb 6, 2018
2 parents c2ee59f + 55468d5 commit c075bfd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/NServiceBus.Hosting.Windows/WindowsHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace NServiceBus.Hosting.Windows
/// </summary>
public class WindowsHost : MarshalByRefObject
{
ILog Log = LogManager.GetLogger<WindowsHost>();
NServiceBus.GenericHost genericHost;

/// <summary>
Expand All @@ -34,7 +33,9 @@ public void Start()
}
catch (Exception ex)
{
Log.Fatal("Start failure", ex);
var log = LogManager.GetLogger<WindowsHost>(); // Defers logger creation to allow custom logging configuration

log.Fatal("Start failure", ex);
Environment.Exit(-1);
}
}
Expand All @@ -50,10 +51,10 @@ public void Stop()
}
catch (Exception ex)
{
Log.Fatal("Stop failure", ex);
var log = LogManager.GetLogger<WindowsHost>(); // Defers logger creation to allow custom logging configuration
log.Fatal("Stop failure", ex);
Environment.Exit(-2);
}
}

}
}

0 comments on commit c075bfd

Please sign in to comment.