From c1e036a82627018b90a73557c126090e539a4a7c Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Thu, 13 Oct 2022 12:54:21 -0700 Subject: [PATCH] Include scope properties (#210) Signed-off-by: Victor Chang --- src/InformaticsGateway/Program.cs | 2 +- src/InformaticsGateway/nlog.config | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/InformaticsGateway/Program.cs b/src/InformaticsGateway/Program.cs index 67e055999..f1212ad8e 100644 --- a/src/InformaticsGateway/Program.cs +++ b/src/InformaticsGateway/Program.cs @@ -189,7 +189,7 @@ internal static IHostBuilder CreateHostBuilder(string[] args) => private static NLog.Logger ConfigureNLog(string assemblyVersionNumber) { - LayoutRenderer.Register("servicename", logEvent => Assembly.GetEntryAssembly()?.GetName().Name); + LayoutRenderer.Register("servicename", logEvent => typeof(Program).Namespace); LayoutRenderer.Register("serviceversion", logEvent => assemblyVersionNumber); LayoutRenderer.Register("machinename", logEvent => Environment.MachineName); diff --git a/src/InformaticsGateway/nlog.config b/src/InformaticsGateway/nlog.config index 33925ea64..7bd771f7e 100644 --- a/src/InformaticsGateway/nlog.config +++ b/src/InformaticsGateway/nlog.config @@ -1,4 +1,6 @@ - - - +