title: Akka logging pattern unchangeable
body: <p>just building a small actor application for my bachelor thesis and now I am trying to add some logging.</p>
  
  <p>For logging inside the actorsystem I want to use the logging akka provides with logback-classic in the background.
  The logging is working well so far but the pattern inside the actor system doesn't change when I change it in the logback.xml</p>
  
  <p>Anyone an idea how to change the pattern that is global and used by logging via slf4j and logging inside the actorsystem?</p>
  
  <p><strong>log output outside the actor system:</strong></p>
  
  <pre><code>2014-07-11 13:03:09 INFO  model.AccessLayer : New Object 10 with id:188586187441591506  `
  2014-07-11 13:03:09 INFO  model.AccessLayer : New Object 11 with id:188586187442115794`
  </code></pre>
  
  <p><strong>log output from inside the actor system:</strong></p>
  
  <pre><code>[INFO] [07/11/2014 13:03:09.199] [EBTreeSimulation-akka.actor.default-dispatcher-4] [akka://EBTreeSimulation/user/nodeA] nodeA[InsertNewObject] received new object:188586187441591506, 188586187441591506, 10 
  
  [INFO] [07/11/2014 13:03:09.199] [EBTreeSimulation-akka.actor.default-dispatcher-3] [akka://EBTreeSimulation/user/nodeB] nodeB[InsertNewObject] received new object:188586187441591506, 188586187441591506, 10
  </code></pre>
  
  <p><strong>Logger initialisation for slf4j:</strong></p>
  
  <p>import org.slf4j.LoggerFactory</p>
  
  <pre><code>class AccessLayer[T](communicationLayer:ActorRef, actors:List[ActorRef]) {
    val log = LoggerFactory.getLogger(classOf[AccessLayer[T]])
    ....
  }
  </code></pre>
  
  <p><strong>Logger initialisation for actorSystem:</strong></p>
  
  <pre><code>import akka.event.Logging
  import com.typesafe.config.ConfigFactory
  
  object SimulationMaster extends App{
     val system = ActorSystem("EBTreeSimulation", ConfigFactory.load.getConfig("akka"))
     val log = Logging.getLogger(system,this)
     ....
  }
  
  import akka.event.Logging
  
  class TreeActor[T](communication:ActorRef) extends Actor {
     val log = Logging(context.system,this)
     ....
  
  }
  </code></pre>
  
  <p><strong>logback.xml:</strong></p>
  
  <pre><code>&lt;configuration&gt;
  &lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;File&gt;./logs/myLog.log&lt;/File&gt;
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"&gt;
          &lt;fileNamePattern&gt;logs/myLog.%i.log.zip&lt;/fileNamePattern&gt;
          &lt;minIndex&gt;1&lt;/minIndex&gt;
          &lt;maxIndex&gt;3&lt;/maxIndex&gt;
      &lt;/rollingPolicy&gt;
      &lt;triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"&gt;
          &lt;maxFileSize&gt;5MB&lt;/maxFileSize&gt;
      &lt;/triggeringPolicy&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%date{YYYY-MM-dd HH:mm:ss} %level %X{sourceThread} %logger{10} [%file:%line]: %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
      &lt;!--&lt;target&gt;System.out&lt;/target&gt;--&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%date{YYYY-MM-dd HH:mm:ss} %-5level %logger : %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  &lt;!--&lt;logger name="akka" level="INFO" /&gt;--&gt;
  &lt;root level="info"&gt;
      &lt;appender-ref ref="FILE"/&gt;
      &lt;appender-ref ref="STDOUT" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>application.conf:</strong></p>
  
  <pre><code>akka {
      # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs
      # to STDOUT)
      loggers = ["akka.event.slf4j.Slf4jLogger"]
      #event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
  
      loglevel = "INFO"   
      stdout-loglevel = "DEBUG"
      actor {
         provider = "akka.cluster.ClusterActorRefProvider"
          default-dispatcher {
              throughput = 10
          }
      }
      remote {
          netty.tcp.port = 4711
      }
  }
  </code></pre>