From 5ca783fef57a23f9e0ee3d4c826c77e8b9155d6b Mon Sep 17 00:00:00 2001 From: Ismael Hamed Date: Thu, 25 Apr 2019 02:45:42 +0200 Subject: [PATCH] OnPersistRejected now logs an error with the complete stacktrace (#3763) --- src/core/Akka.Persistence/Eventsourced.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/Akka.Persistence/Eventsourced.cs b/src/core/Akka.Persistence/Eventsourced.cs index 9ea989a23ba..aba68f43706 100644 --- a/src/core/Akka.Persistence/Eventsourced.cs +++ b/src/core/Akka.Persistence/Eventsourced.cs @@ -469,7 +469,7 @@ protected virtual void OnRecoveryFailure(Exception reason, object message = null { if (message != null) { - Log.Error(reason, "Exception in ReceiveRecover when replaying event type [{0}] with sequence number [{1}] for persistenceId [{2}]", + Log.Error(reason, "Exception in ReceiveRecover when replaying event type [{0}] with sequence number [{1}] for persistenceId [{2}]", message.GetType(), LastSequenceNr, PersistenceId); } else @@ -499,7 +499,7 @@ protected virtual void OnPersistFailure(Exception cause, object @event, long seq /// /// Called when the journal rejected of an event. - /// The event was not stored. By default this method logs the problem as a warning, and the actor continues. + /// The event was not stored. By default this method logs the problem as an error, and the actor continues. /// The callback handler that was passed to the /// method will not be invoked. /// @@ -508,9 +508,8 @@ protected virtual void OnPersistFailure(Exception cause, object @event, long seq /// TBD protected virtual void OnPersistRejected(Exception cause, object @event, long sequenceNr) { - if (Log.IsWarningEnabled) - Log.Warning("Rejected to persist event type [{0}] with sequence number [{1}] for persistenceId [{2}] due to [{3}].", - @event.GetType(), sequenceNr, PersistenceId, cause.Message); + Log.Error(cause, "Rejected to persist event type [{0}] with sequence number [{1}] for persistenceId [{2}] due to [{3}].", + @event.GetType(), sequenceNr, PersistenceId, cause.Message); } ///