From 47a85403cdcc9de12efacb8d87d9b129bd2ad433 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 20 Jan 2019 17:13:09 +0100 Subject: [PATCH] Logging for command. --- .../Commands/DomainObjectGrainBase.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Squidex.Infrastructure/Commands/DomainObjectGrainBase.cs b/src/Squidex.Infrastructure/Commands/DomainObjectGrainBase.cs index 04ba13d80..61501f7ac 100644 --- a/src/Squidex.Infrastructure/Commands/DomainObjectGrainBase.cs +++ b/src/Squidex.Infrastructure/Commands/DomainObjectGrainBase.cs @@ -49,10 +49,12 @@ namespace Squidex.Infrastructure.Commands protected sealed override async Task OnActivateAsync(Guid key) { - using (log.MeasureInformation(w => w + var logContext = (key: key.ToString(), name: GetType().Name); + + using (log.MeasureInformation(logContext, (ctx, w) => w .WriteProperty("action", "ActivateDomainObject") - .WriteProperty("domainObjectType", GetType().Name) - .WriteProperty("domainObjectKey", key.ToString()))) + .WriteProperty("domainObjectType", ctx.name) + .WriteProperty("domainObjectKey", ctx.key))) { id = key;