How to change log level from command line?

前端 未结 2 1188
暗喜
暗喜 2020-12-16 13:28

How can I change the log level in sbt at the command line without modifying the existing configuration?

2条回答
  •  自闭症患者
    2020-12-16 14:19

    For SBT 0.12:

    If you want to change the log level from the command line, you may do in sbt interactive mode without changing your build.sbt file or any configuration. Just type:

    > set logLevel := Level.Debug
    

    However if you are writing some scripts that will run in your server and you can't do interactively, you will have to create a boot.properties file setting the desired log level and pass this file in the command line, by running

    sbt -Dsbt.boot.properties=path-to-your-boot.properties
    

    Check the documentation for boot.properties here

提交回复
热议问题