How to read Logback configuration file from path outside the war file?

前端 未结 2 840
情书的邮戳
情书的邮戳 2021-01-23 12:19

I have a requirement where I want to place all logback configuration outside the war file. Presently I have placed my configuration file (logback.xml) on the classpath. I am usi

相关标签:
2条回答
  • 2021-01-23 13:01

    Go into the jboss startup/run script and add this option:

    java -Dlogback.configurationFile=/path/to/config.xml chapters.configuration.MyApp1

    see more at http://logback.qos.ch/manual/configuration.html

    0 讨论(0)
  • 2021-01-23 13:19

    You could also use -Dlogging.config=/path/to/logback.xml

    This is really handy with java based microservices to provide logging XML externally.

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