【发布时间】:2014-04-08 21:04:14
【问题描述】:
我有 EAR,其中包含多个 jar,其中两个 jar 包含“log.properties”
例如:在 abc.jar 中,“log.properties”在 com.abc.test 中 而在 xyz.jar 中,“log.properties”在 com.xyz.test 中
在这两个包中,我们都有记录器实现,它将“log.properties”加载为 this.getClass().getClassLoader().getResourceAsStream("log.properties");
由于类加载器首先加载另一个 jar,它拾取了他的“log.properties”
我想避免这个问题 有什么建议吗?
【问题讨论】:
-
无法更改属性文件名?
-
不,因为它已经部署在服务器上。大多数模块都使用日志实现器
标签: java jakarta-ee logging classloader