java - Classloader loading wrong log.properties file -
i have ear contains multiple jars out of 2 of jar contains "log.properties"
for eg: in abc.jar, "log.properties" in com.abc.test , in xyz.jar, "log.properties" in com.xyz.test
in both package have logger implementation load "log.properties" this.getclass().getclassloader().getresourceasstream("log.properties");
due classloader loads other jar first pickup "log.properties"
i want avoid problem suggestions ?
use classloader.getresources(string name) , write code filter out urls not in same package class. place code in utility or resource manager class , use everywhere in project.
Comments
Post a Comment