如何从war文件以外的路径读取Logback配置文件? [英] How to read Logback configuration file from path outside the war file?

查看:900
本文介绍了如何从war文件以外的路径读取Logback配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,我想把所有logback配置war文件外。
目前,我已将我的配置文件(logback.xml)放在类路径上。
我使用的是JBOSS EAP web应用程序服务器,建议如何实现相同的。

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.

推荐答案

进入jboss启动/运行脚本并添加此选项:

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

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

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

查看 http://logback.qos.ch/manual/configuration.html

这篇关于如何从war文件以外的路径读取Logback配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆