How to configure logging when running a JAR?

前端 未结 3 988
一整个雨季
一整个雨季 2021-02-14 14:15

I am new to Java logging API and need some help with this problem: While creating the application, my config file was stored in the project root folder, so I used -Djava.u

3条回答
  •  孤街浪徒
    2021-02-14 14:46

    I know it's little late to answer this question but I ran into this issue few days back with the runnable jar and I solved it like this:

    java -Djava.util.logging.config.file=logging.properties -cp test.jar com.sample.test.Main

    where test.jar is the name of your jar and com.sample.test.Main is the fully qualified name of your main class.

提交回复
热议问题