浏览 144 次
|
该帖已经被评为新手帖
|
|
|---|---|
| 作者 | 正文 |
|
最后更新时间:2008-06-29
方法一:
Properties prop = new Properties(); File f = new File("绝对路径"); FileInputStream is = null; try { is = new FileInputStream(f); prop.load(is); PropertyConfigurator.configure(prop); } catch (FileNotFoundException e) { e.printStackTrace(); } 方法二: ClassLoader cl = Thread.currentThread().getContextClassLoader(); InputStream is = null; is = cl.getResourceAsStream("config/Log4j.properties"); Properties prop = new Properties(); prop.load(is); PropertyConfigurator.configure(prop); 声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |


