如何从外部文件夹访问logback.xml

时间:2013-10-22 06:32:12

标签: tomcat6 logback weblogic-10.x

我正在使用logback API登录我的项目,但要求是两个项目将有单个logback.xml配置文件,并且应该从项目外部访问logback.xml。

我已将logback.xml放在我的项目类路径中,这很正常。任何机构都可以建议我如何从外部文件夹访问日志配置文件?

1 个答案:

答案 0 :(得分:0)

您可能会发现Logback常见问题解答部分有用:Is it possible for multiple JEE applications to share the same configuration file but without stepping on each other's toes?

简而言之,您可以使用JoranConfigurator.doConfigure("/path/to/your/config/file.xml")使用所需的任何配置文件(前提是您的Java应用程序可以访问它)。 HTH!

相关问题