diff --git a/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs b/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs index 07a1d31f2..afb218031 100644 --- a/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs +++ b/backend/src/Squidex.Infrastructure/Commands/DomainObject.cs @@ -152,7 +152,7 @@ public abstract partial class DomainObject : IAggregate where T : Entity, new } catch (Exception ex) { - log.LogError(ex, "Failed to repair snapshot for domain object of type {type} with ID {id}.", GetType(), UniqueId); + LogMessages.LogFailedToRepairDomainObjectSnapshot(log, GetType(), UniqueId, ex); } } diff --git a/backend/src/Squidex.Infrastructure/LogMessages.cs b/backend/src/Squidex.Infrastructure/LogMessages.cs index ff0a46e36..0577f22f3 100644 --- a/backend/src/Squidex.Infrastructure/LogMessages.cs +++ b/backend/src/Squidex.Infrastructure/LogMessages.cs @@ -55,4 +55,7 @@ internal static partial class LogMessages [LoggerMessage(Level = LogLevel.Error, Message = "Failed to track usage in background.")] public static partial void LogTrackUsageFailed(ILogger logger, Exception exception); + + [LoggerMessage(Level = LogLevel.Error, Message = "Failed to repair snapshot for domain object of type {type} with ID {id}.")] + public static partial void LogFailedToRepairDomainObjectSnapshot(ILogger logger, Type type, DomainId id, Exception exception); }