diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Program.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Program.cs index 8039854da..52461e310 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Program.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Program.cs @@ -3,6 +3,7 @@ using NLog.Web; using SFA.DAS.EmployerCommitmentsV2.Web.Startup; using StructureMap.AspNetCore; +using System; namespace SFA.DAS.EmployerCommitmentsV2.Web { @@ -10,6 +11,10 @@ public static class Program { public static void Main(string[] args) { + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + var logger = NLogBuilder.ConfigureNLog(environment == "Development" ? "nlog.Development.config" : "nlog.config").GetCurrentClassLogger(); + logger.Info("Starting up host"); + CreateWebHostBuilder(args).Build().Run(); } diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config new file mode 100644 index 000000000..b2842fb6d --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.config b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.config index b9504c5d1..ca12e440f 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.config +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.config @@ -7,10 +7,9 @@ - - + \ No newline at end of file