Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Akka application packaging with logger #565

Closed
salex89 opened this issue Apr 28, 2015 · 2 comments
Closed

Akka application packaging with logger #565

salex89 opened this issue Apr 28, 2015 · 2 comments

Comments

@salex89
Copy link

salex89 commented Apr 28, 2015

Sbt-native-packager version: 0.8.0-M2
sbt version: 0.13.5
Akka version: 2.3.9
I'm having issues configuring the logging with the akka_application packaging. In my IDE everything works fine, and when the application is run with activator run. But when packaged, the logger configuration is ignored and everything is set to DEBUG, and used some other format, different from what I specified. Also, I see messages about multiple slf4j bindings present. I'm using akka-slf4j and logback (logback.xml is set in the classpath).

To be clear, I first run the sbt stage task, and then run the generated bash script.

Some configuration missing?

Maybe not the right place to ask, but is there any pro/con between using akka_application packaging or just activator run in production?

From applicaiton.conf:

akka {
   loggers = ["akka.event.slf4j.Slf4jLogger"]
   loglevel = "DEBUG"
   logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}

logback.xml

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <!-- encoders are assigned the type
         ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
    <encoder>
        <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
</appender>

<root level="warn">
    <appender-ref ref="STDOUT"/>
</root>

build.sbt:

packageArchetype.akka_application
libraryDependencies += "com.typesafe.akka" %% "akka-slf4j" % "2.3.9" % "compile"

libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.0.13"

//Other dependencies
libraryDependencies ~= {
  _.map(_.exclude("org.slf4j", "slf4j-log4j12"))
}   

//~~ SBT native packager settings ~~//
mainClass in Compile := Some("com.nissatech.mca.worker.Launcher")
@salex89
Copy link
Author

salex89 commented Apr 28, 2015

Update: This could be close, if there is no interest. I solved it by using the native packager 1.0.0 and the JavaApp Archetype.

@muuki88
Copy link
Contributor

muuki88 commented Apr 28, 2015

Sweet. I would have suggested using 1.0.0 and if not possible 0.8.0.

@muuki88 muuki88 closed this as completed Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants