I assume that you are using the Akka 2.0 milestone, and I also assume that you get your registrar as follows:
val log = Logging(context.system, this)
As indicated, the standard representation of an actor in terms of the category of a magazine is its path. Unfortunately, logback is not ready to work with actor hierarchies, it is configured to handle package names (i.e. separated by hierarchy points), so your parameter affects the wrong registrar. Recently, there have been some changes in this area in the Akka workshop, which will be part of milestone 3 (coming soon), where the default journal category will be derived from the actual implementation class (according to LoggerFactory.getLogger(someClass) ). If you want to achieve the same result in your old version of Akka, use
val log = Logging(context.system, getClass.getName)
Please note that it is NOT NECESSARY to combine the actor name hierarchy with the names of your packages, i.e. you will have to set up a class for each actor, as is usually the case with traditional Java frameworks. If you want this, write your own conversion from the actorβs path to a hierarchical name, separated by a dot, and pass the resulting string to the factory:
val log = Logging(context.system.eventStream, mangleMyName(self.path))
A change when using eventStream instead of a simple system will be necessary after you upgrade to a later version, since another change was that the system name will now be added to the simple categories of logging while going through the system. Suppose system.name == "Fred" :
val log = Logging(context.system, "testa") // will log as "testa(Fred)"
Roland Kuhn
source share