title: How can I get the name of an Akka actor from within the actor itself?
body: <p>So, if I have an actor, I can give it a name. But, can I access that name internally? Example:</p>
  
  <pre><code>class Actorz extends Actor with ActorLogging {
     val actorName = //??What function
  
     def receive = {
       case x =&gt; log.debug(actorName+": Received Message: "+x)
     }
  }
  
  val actor = system.actorOf(Props[Actorz], "named")
  actor ! "dogs"
  </code></pre>
  
  <p>Now, I can pass its name as a constructor parameter. But, that seems like unnecessary duplication if there is a way to get the name internally... as it was set when I instantiated the actor using <code>system.actorOf</code>. API docs didn't seem to have anything.</p>