From 83567dea1ce9150746b6ad8eaa58ae30add27e6a Mon Sep 17 00:00:00 2001 From: "Scott B. Arbeit" Date: Sun, 28 Jul 2024 00:46:03 -0700 Subject: [PATCH] Logging format improvements. --- src/Grace.Actors/Branch.Actor.fs | 2 +- src/Grace.Actors/BranchName.Actor.fs | 3 ++- src/Grace.Actors/Diff.Actor.fs | 2 +- src/Grace.Actors/DirectoryVersion.Actor.fs | 2 +- src/Grace.Actors/Organization.Actor.fs | 2 +- src/Grace.Actors/OrganizationName.Actor.fs | 3 ++- src/Grace.Actors/Owner.Actor.fs | 2 +- src/Grace.Actors/OwnerName.Actor.fs | 3 ++- src/Grace.Actors/Reference.Actor.fs | 2 +- src/Grace.Actors/Repository.Actor.fs | 2 +- src/Grace.Actors/RepositoryName.Actor.fs | 3 ++- 11 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Grace.Actors/Branch.Actor.fs b/src/Grace.Actors/Branch.Actor.fs index bbbe6d3..62a65a6 100644 --- a/src/Grace.Actors/Branch.Actor.fs +++ b/src/Grace.Actors/Branch.Actor.fs @@ -172,7 +172,7 @@ module Branch = let duration_ms = getPaddedDuration_ms activateStartTime log.LogInformation( - "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; Activated {ActorType} {ActorId}. BranchName: {BranchName}; {message}.", + "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; CorrelationId: ; Activated {ActorType} {ActorId}. BranchName: {BranchName}; {message}.", getCurrentInstantExtended (), getMachineName, duration_ms, diff --git a/src/Grace.Actors/BranchName.Actor.fs b/src/Grace.Actors/BranchName.Actor.fs index e5f64e5..84b4d2d 100644 --- a/src/Grace.Actors/BranchName.Actor.fs +++ b/src/Grace.Actors/BranchName.Actor.fs @@ -34,8 +34,9 @@ module BranchName = override this.OnActivateAsync() = log.LogInformation( - "{CurrentInstant}: Duration: 0.100ms; Activated {ActorType} {ActorId}.", + "{CurrentInstant}: Node: {hostName}; Duration: 0.100ms; CorrelationId: ; Activated {ActorType} {ActorId}.", getCurrentInstantExtended (), + getMachineName, this.GetType().Name, host.Id ) diff --git a/src/Grace.Actors/Diff.Actor.fs b/src/Grace.Actors/Diff.Actor.fs index 1d87868..2e22a05 100644 --- a/src/Grace.Actors/Diff.Actor.fs +++ b/src/Grace.Actors/Diff.Actor.fs @@ -171,7 +171,7 @@ module Diff = let duration_ms = getCurrentInstant().Minus(activateStartTime).TotalMilliseconds.ToString("F3") log.LogInformation( - "{CurrentInstant}: Activated {ActorType} {ActorId}. {message} Duration: {duration_ms}ms.", + "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; CorrelationId: ; Activated {ActorType} {ActorId}. BranchName: {BranchName}; {message}.", getCurrentInstantExtended (), actorName, host.Id, diff --git a/src/Grace.Actors/DirectoryVersion.Actor.fs b/src/Grace.Actors/DirectoryVersion.Actor.fs index 1290efb..87eef17 100644 --- a/src/Grace.Actors/DirectoryVersion.Actor.fs +++ b/src/Grace.Actors/DirectoryVersion.Actor.fs @@ -98,7 +98,7 @@ module DirectoryVersion = let duration_ms = getPaddedDuration_ms activateStartTime log.LogInformation( - "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; Activated {ActorType} {ActorId}. {message}.", + "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; CorrelationId: ; Activated {ActorType} {ActorId}. {message}.", getCurrentInstantExtended (), getMachineName, duration_ms, diff --git a/src/Grace.Actors/Organization.Actor.fs b/src/Grace.Actors/Organization.Actor.fs index 2cfb95d..18d3416 100644 --- a/src/Grace.Actors/Organization.Actor.fs +++ b/src/Grace.Actors/Organization.Actor.fs @@ -83,7 +83,7 @@ module Organization = let duration_ms = getPaddedDuration_ms activateStartTime log.LogInformation( - "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; Activated {ActorType} {ActorId}. {message}.", + "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; CorrelationId: ; Activated {ActorType} {ActorId}. {message}.", getCurrentInstantExtended (), getMachineName, duration_ms, diff --git a/src/Grace.Actors/OrganizationName.Actor.fs b/src/Grace.Actors/OrganizationName.Actor.fs index 6ae3b09..f22a308 100644 --- a/src/Grace.Actors/OrganizationName.Actor.fs +++ b/src/Grace.Actors/OrganizationName.Actor.fs @@ -35,8 +35,9 @@ module OrganizationName = override this.OnActivateAsync() = log.LogInformation( - "{CurrentInstant}: Duration: 0.100ms; Activated {ActorType} {ActorId}.", + "{CurrentInstant}: Node: {hostName}; Duration: 0.100ms; CorrelationId: ; Activated {ActorType} {ActorId}.", getCurrentInstantExtended (), + getMachineName, this.GetType().Name, host.Id ) diff --git a/src/Grace.Actors/Owner.Actor.fs b/src/Grace.Actors/Owner.Actor.fs index 3003269..7c8f39b 100644 --- a/src/Grace.Actors/Owner.Actor.fs +++ b/src/Grace.Actors/Owner.Actor.fs @@ -94,7 +94,7 @@ module Owner = let duration_ms = getPaddedDuration_ms activateStartTime log.LogInformation( - "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; Activated {ActorType} {ActorId}. {message}.", + "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; CorrelationId: ; Activated {ActorType} {ActorId}. {message}.", getCurrentInstantExtended (), getMachineName, duration_ms, diff --git a/src/Grace.Actors/OwnerName.Actor.fs b/src/Grace.Actors/OwnerName.Actor.fs index c116ae0..b628bbf 100644 --- a/src/Grace.Actors/OwnerName.Actor.fs +++ b/src/Grace.Actors/OwnerName.Actor.fs @@ -31,8 +31,9 @@ module OwnerName = override this.OnActivateAsync() = log.LogInformation( - "{CurrentInstant}: Duration: 0.100ms; Activated {ActorType} {ActorId}.", + "{CurrentInstant}: Node: {hostName}; Duration: 0.100ms; CorrelationId: ; Activated {ActorType} {ActorId}.", getCurrentInstantExtended (), + getMachineName, this.GetType().Name, host.Id ) diff --git a/src/Grace.Actors/Reference.Actor.fs b/src/Grace.Actors/Reference.Actor.fs index 35a2fad..64e8a5f 100644 --- a/src/Grace.Actors/Reference.Actor.fs +++ b/src/Grace.Actors/Reference.Actor.fs @@ -88,7 +88,7 @@ module Reference = let duration_ms = getPaddedDuration_ms activateStartTime log.LogInformation( - "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; Activated {ActorType} {ActorId}. {message}.", + "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; CorrelationId: ; Activated {ActorType} {ActorId}. {message}.", getCurrentInstantExtended (), getMachineName, duration_ms, diff --git a/src/Grace.Actors/Repository.Actor.fs b/src/Grace.Actors/Repository.Actor.fs index b05fbb2..c94e058 100644 --- a/src/Grace.Actors/Repository.Actor.fs +++ b/src/Grace.Actors/Repository.Actor.fs @@ -73,7 +73,7 @@ module Repository = let duration_ms = getPaddedDuration_ms activateStartTime log.LogInformation( - "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; Activated {ActorType} {ActorId}. {message}.", + "{currentInstant}: Node: {hostName}; Duration: {duration_ms}ms; CorrelationId: ; Activated {ActorType} {ActorId}. {message}.", getCurrentInstantExtended (), getMachineName, duration_ms, diff --git a/src/Grace.Actors/RepositoryName.Actor.fs b/src/Grace.Actors/RepositoryName.Actor.fs index 7330614..56860cf 100644 --- a/src/Grace.Actors/RepositoryName.Actor.fs +++ b/src/Grace.Actors/RepositoryName.Actor.fs @@ -36,8 +36,9 @@ module RepositoryName = override this.OnActivateAsync() = log.LogInformation( - "{CurrentInstant}: Duration: 0.100ms; Activated {ActorType} {ActorId}.", + "{CurrentInstant}: Node: {hostName}; Duration: 0.100ms; CorrelationId: ; Activated {ActorType} {ActorId}.", getCurrentInstantExtended (), + getMachineName, this.GetType().Name, host.Id )