How to read Logback configuration file from path o

2020-05-04 09:58发布

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 using the JBOSS EAP web application server, kindly suggest how to achieve the same.

2条回答
我只想做你的唯一
2楼-- · 2020-05-04 10:26

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

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

查看更多
该账号已被封号
3楼-- · 2020-05-04 10:45

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

查看更多
登录 后发表回答