I'm search for the best way way to set up my logging/config in production within my deb file using the sbt-native-packager.
a.) I want to copy my reference.conf
and logback.xml
from my code repository to /etc/my-app/reference.conf
or /etc/my-app/logback.xml
. I guess its somehow possible with linuxPackageMappings
but i could'nt find a example yet and I'm still struggling to get how SBT and the plugings work together.
b.) I need to tell my jvm that i should use this config and this logback config when started via the created upstart - how do I pass parameters from the build.scala to the jvm-runscript
this is my current project val:
lazy val root = Project(id = appName, base = file("."), settings = JavaServerAppPackaging.settings ++ packageSettings ++ allSettings ++ Project.defaultSettings)
lazy val allSettings = Seq(
resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases",
resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/",
libraryDependencies ++= dependencies)
lazy val packageSettings = packageArchetype.java_server ++ Seq(
bashScriptExtraDefines := Seq("aha"),
version := appVersion,
packageSummary := appName,
packageDescription := appName,
maintainer := appAuthor,
debianPackageDependencies in Debian ++= Seq("openjdk-7-jre-headless"))
thanks
Lots of questions mixed in hear...
a) So to you can install your conf and xml files by including them in your debian package. Building debian packages is not built in to sbt out of the box. You could try https://github.com/sbt/sbt-native-packager but you may be better of dropping out of sbt and just using one of the many normal ways to create debian packages.
Note that you should not be logging to /etc on a linux box. Logs should go under /var
b) you can install an init script that has -D peramiters to tell play where to find its conf and logback.xml files.
$JAVA_HOME/bin/java -Dconfig.file=/etc/foo.comf -Dlogger.file=/etc/logger.xml
c) you should be logging to some directory under /var
You can create directories in the postinst script that is part of the debian package. puppet (or something similar) can be a better way to manage config files on deployed boxes though.