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 736c5ce
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ public M004_WorkflowRevision_AddDataRetension() : base("1.0.1") { }

public override void Up(BsonDocument document)
{
// document.Add("Workflow.DataRetentionDays", BsonNull.Create(null).ToJson(), true);
var workflow = document["Workflow"].AsBsonDocument;
workflow.Add("DataRetentionDays", BsonNull.Create(null).ToJson(), true);
workflow.Add("DataRetentionDays", -1, true);
}

public override void Down(BsonDocument document)
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 736c5ce

Please sign in to comment.