If I create an logging actor like so
val logger: ActorRef =
    actorSystem.actorOf(Props(new Logger()))
and the logger restarts due to an Exception, my logger stops writing to disk.
I had been sending messages logger ! msg
Am I correct in assuming that the ActorRef did not update when the supervisor restarted my logging actor?
 
                        
ActorRefshould be properly updated by Akka to point to the new instance of an actor. The docs clearly state that:Also here:
That's one of the main advantages of using
ActorRefs, otherwise it would be much more inconvenient to work with actors.You need to check your supervisor strategy and make sure that the actor is actually restarted. Default strategy is:
Thus if you get an
Exceptionyour actor will be restarted andActorRefshould be valid, but if you get other types ofThrowablethen it will be stopped andActorRefwill become invalid.