start shell script from “play dist” fails to locate logger.xml in JAR file

后端 未结 1 1553
醉酒成梦
醉酒成梦 2021-01-14 03:07

I\'m new to Play 2.1 and am trying to figure out the easiest way to deploy Play into our ops environment. The out-of-the-box Play 2.1 capability that holds the most promise

相关标签:
1条回答
  • 2021-01-14 03:24

    I recommend editing your production start script to add the following to your java command line:

    -Dconfig.resource=/conf/logger.xml
    

    That will find the logger config if it's in your classpath. (I think there's also a -Dconfig.file alternative). I also recommend adding a configuration directory to your classpath, so your play start command will be something like:

    MYAPP_HOME=~/myapp
    java -cp $MYAPP_HOME:$MYAPP_HOME/lib/* play.core.server.NettyServer $MYAPP_HOME
    

    By getting your config from a directory in your classpath rather than from a jar file, you gain the ability to edit it, or to specify different versions.

    0 讨论(0)
提交回复
热议问题