Skip to content

Commit

Permalink
improving logging
Browse files Browse the repository at this point in the history
Signed-off-by: Neil South <[email protected]>
  • Loading branch information
neildsouth committed Jan 31, 2024
1 parent 6f9a834 commit 975d8e5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/TaskManager/TaskManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ private static Logger ConfigureNLog(string assemblyVersionNumber)
ext.RegisterLayoutRenderer("servicename", logEvent => typeof(Program).Namespace);
ext.RegisterLayoutRenderer("serviceversion", logEvent => assemblyVersionNumber);
ext.RegisterLayoutRenderer("machinename", logEvent => Environment.MachineName);
ext.RegisterLayoutRenderer("appname", logEvent => "TaskManager");
})
.LoadConfigurationFromAppSettings()
.GetCurrentClassLogger();
Expand Down
1 change: 1 addition & 0 deletions src/TaskManager/TaskManager/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ limitations under the License.
<attribute name="Tag" layout="${environment:ENVIRONMENT_NAME}" />
<attribute name="ServiceName" layout="${servicename}" />
<attribute name="ServiceVersion" layout="${serviceversion}" />
<attribute name="ApplicationName" layout="${appname}" />
<attribute name="MachineName" layout="${machinename}" />
<attribute name="CorrelationId" layout="${mdlc:item=correlationId}" />
<attribute name="LoggerName" layout="${logger}" />
Expand Down
1 change: 1 addition & 0 deletions src/WorkflowManager/WorkflowManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ private static Logger ConfigureNLog(string assemblyVersionNumber)
ext.RegisterLayoutRenderer("servicename", logEvent => typeof(Program).Namespace);
ext.RegisterLayoutRenderer("serviceversion", logEvent => assemblyVersionNumber);
ext.RegisterLayoutRenderer("machinename", logEvent => Environment.MachineName);
ext.RegisterLayoutRenderer("appname", logEvent => "WorkflowManager");
})
.LoadConfigurationFromAppSettings()
.GetCurrentClassLogger();
Expand Down
1 change: 1 addition & 0 deletions src/WorkflowManager/WorkflowManager/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ limitations under the License.
<attribute name="Tag" layout="${environment:ENVIRONMENT_NAME}" />
<attribute name="ServiceName" layout="${servicename}" />
<attribute name="ServiceVersion" layout="${serviceversion}" />
<attribute name="ApplicationName" layout="${appname}" />
<attribute name="MachineName" layout="${machinename}" />
<attribute name="CorrelationId" layout="${mdlc:item=correlationId}" />
<attribute name="LoggerName" layout="${logger}" />
Expand Down

0 comments on commit 975d8e5

Please sign in to comment.