I searched quite a lot, but did not find a working solution. Can someone please help me?
akka { event-handlers = ["akka.event.slf4j.Slf4jEventHandler"] loggers = ["akka.event.slf4j.Slf4jLogger"] loglevel = "DEBUG" logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" stdout-loglevel = "WARNING" actor { debug { receive = on lifecycle = off } } }
and I added the following to build.sbt in the hope that one of them solves the problem:
libraryDependencies ++= Seq ( "com.typesafe.akka" %% "akka-actor" % "2.4.1", // akka actors "ch.qos.logback" % "logback-classic" % "1.1.3", //logback, in order to log to file "com.typesafe.scala-logging" % "scala-logging-slf4j_2.11" % "2.1.2", "com.typesafe.akka" % "akka-slf4j_2.11" % "2.4.1", // needed for logback to work // and my other dependencies )
and I tried with various sentences that I found for logback.xml , the last of which:
<configuration> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>logs/filename.log</file> <encoder> <pattern>%date %level %msg%n</pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <maxIndex>10</maxIndex> <FileNamePattern>logs/filename.log.%i.gz</FileNamePattern> </rollingPolicy> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <maxFileSize>20MB</maxFileSize> </triggeringPolicy> </appender> <root level="info"> <appender-ref ref="FILE" /> </root> </configuration>
EDIT: My full dependencies are as follows (ps: I currently have both lift and salat for de / serialization, but that's a different story):
libraryDependencies ++= Seq ( "org.scala-lang" % "scalap" % scalaVersion.value, "com.typesafe.akka" %% "akka-actor" % "2.4.1", "ch.qos.logback" % "logback-classic" % "1.1.3", "com.typesafe.scala-logging" % "scala-logging-slf4j_2.11" % "2.1.2", "com.typesafe.akka" %% "akka-slf4j" % "2.4.1", "com.github.sstone" %% "amqp-client" % "1.5", "net.liftweb" %% "lift-json" % "2.6.2", "net.liftweb" %% "lift-json-ext" % "2.6.2", "org.scalatest" %% "scalatest" % "2.2.4" % "test", "com.novus" %% "salat" % "1.9.9" )