URL?url?
=
?UserServiceImpl.
class
.getResource(
"
/config/log4j.properties
"
);
Properties?properties? = ? new ?Properties();
try ?{
???? properties.load( new ?InputStreamReader(url.openStream()));
??? }? catch ?(IOException?e)?{
??????? e.printStackTrace();
??? }
PropertyConfigurator.configure(properties);
Properties?properties? = ? new ?Properties();
try ?{
???? properties.load( new ?InputStreamReader(url.openStream()));
??? }? catch ?(IOException?e)?{
??????? e.printStackTrace();
??? }
PropertyConfigurator.configure(properties);
/config/log4j.properties 可以放在對應的jar文件中