diff --git a/akka-persistence/src/main/scala/akka/persistence/Eventsourced.scala b/akka-persistence/src/main/scala/akka/persistence/Eventsourced.scala index ef852086c1..d43387c1a3 100644 --- a/akka-persistence/src/main/scala/akka/persistence/Eventsourced.scala +++ b/akka-persistence/src/main/scala/akka/persistence/Eventsourced.scala @@ -4,18 +4,18 @@ package akka.persistence -import java.util.concurrent.atomic.AtomicInteger import java.util.UUID +import java.util.concurrent.atomic.AtomicInteger -import scala.collection.immutable -import scala.util.control.NonFatal -import akka.actor.{ StashOverflowException, DeadLetter, ActorCell } +import akka.actor.{ ActorCell, DeadLetter, StashOverflowException } import akka.annotation.InternalApi import akka.dispatch.Envelope +import akka.event.{ Logging, LoggingAdapter } import akka.util.Helpers.ConfigOps -import akka.event.Logging -import akka.event.LoggingAdapter + +import scala.collection.immutable import scala.concurrent.duration.FiniteDuration +import scala.util.control.NonFatal /** * INTERNAL API @@ -44,10 +44,9 @@ private[persistence] object Eventsourced { */ private[persistence] trait Eventsourced extends Snapshotter with PersistenceStash with PersistenceIdentity with PersistenceRecovery { - import JournalProtocol._ - import SnapshotProtocol.LoadSnapshotResult - import SnapshotProtocol.LoadSnapshotFailed import Eventsourced._ + import JournalProtocol._ + import SnapshotProtocol.{ LoadSnapshotFailed, LoadSnapshotResult } { val interfaces = getClass.getInterfaces @@ -153,14 +152,15 @@ private[persistence] trait Eventsourced extends Snapshotter with PersistenceStas /** * Called when the journal rejected `persist` of an event. The event was not - * stored. By default this method logs the problem as a warning, and the actor continues. + * stored. By default this method logs the problem as an error, and the actor continues. * The callback handler that was passed to the `persist` method will not be invoked. * * @param cause failure cause * @param event the event that was to be persisted */ protected def onPersistRejected(cause: Throwable, event: Any, seqNr: Long): Unit = { - log.warning( + log.error( + cause, "Rejected to persist event type [{}] with sequence number [{}] for persistenceId [{}] due to [{}].", event.getClass.getName, seqNr, persistenceId, cause.getMessage) }