The application-logged msg of an akka application seems to be always directed to java.util.logging.
I want to customize the logging by using slf4j and logback.
In application.conf, I set
akka.loggers = ["akka.event.slf4j.Slf4jLogger"]
In build.sbt, I set
libraryDependencies ++= Seq(
otherjars,
"com.typesafe.akka" %% "akka-slf4j" % "2.3.3",
"ch.qos.logback" % "logback-classic" % "1.1.1",
"com.typesafe.scala-logging" %% "scala-logging" % "3.1.0"
)
I also set logback.xml as
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<encoder>
<!-- <pattern>%logger{1} - %msg%n</pattern> -->
<pattern>[%level{10}] [%date{ISO8601}] Thread:[%thread] SourceThread:[%X{sourceThread}] AkkaSource:[%X{akkaSource}] %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="akka" level="INFO" />
<logger name="sample.kamon" level="DEBUG"/>
<root level="ALL">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
When I run it, the application log msg is not in the expected form as
[INFO] [2014-09-30 17:51:20,609] Thread:[application-akka.actor.default-dispatcher-20] SourceThread:[application-akka.actor.default-dispatcher-19] AkkaSource:[akka://application/user/artifical/peak:generator] sample.kamon.PeakGenerator - schedule peak GenerateNumber
[DEBUG] [2014-09-30 17:51:24,408] Thread:[application-akka.actor.default-dispatcher-10] SourceThread:[] AkkaSource:[] sample.kamon.PeakGenerator - testing schedule peak!!!
but prefixed with an additional label as
[info] [INFO] [2014-09-30 17:51:20,609] Thread:[application-akka.actor.default-dispatcher-20] SourceThread:[application-akka.actor.default-dispatcher-19] AkkaSource:[akka://application/user/artifical/peak:generator] sample.kamon.PeakGenerator - schedule peak GenerateNumber
[info] [DEBUG] [2014-09-30 17:51:24,408] Thread:[application-akka.actor.default-dispatcher-10] SourceThread:[] AkkaSource:[] sample.kamon.PeakGenerator - testing schedule peak!!!
The label [info] seems to be coming from java.util.Logging and does not reflect the actual severity of the application log msg. How to remove it? If Kamon is not used, this problem won't happen.
Thanks again.
Thanks for sharing.
Cheers Diego.
--
You received this message because you are subscribed to the Google Groups "kamon-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kamon-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.