From 1fc4ef4b8c7406fc7a8746b8005f01eea4091e17 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 16 Jun 2020 11:55:09 +0100 Subject: [PATCH 1/3] Nlog fix --- .../Program.cs | 5 +++++ .../nlog.Development.config | 19 +++++++++++++++++++ .../nlog.config | 3 +-- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config 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..e6885630f --- /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 From 5fe18dd8f9908217d576e9f23308b58fdaab8371 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 16 Jun 2020 11:59:19 +0100 Subject: [PATCH 2/3] fix typo --- src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config index e6885630f..1f93cbcd4 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config @@ -11,7 +11,7 @@ - + From 924139674ae64becaa57f1f2e8d65d7ebaf4b298 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 16 Jun 2020 12:01:38 +0100 Subject: [PATCH 3/3] typo fix --- src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config index 1f93cbcd4..b2842fb6d 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/nlog.Development.config @@ -7,7 +7,7 @@ internalLogFile="internal-nlog.txt" throwExceptions="false"> - +