LogConfigruration
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Properties; import org.apache.log4j.PropertyConfigurator; public class LogConfigruration {
public static void initLog(){
String logProper = System.getProperty("user.dir")+"\\res\\log4j.properties";
Properties prop = new Properties();
Reader reader = null;
try {
String log_dir = System.getProperty("user.dir")+"\\test-output";
System.setProperty("LOG_DIR", log_dir);
reader = new FileReader(logProper);
prop.load(reader);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} PropertyConfigurator.configure(prop); }
}
LogConfigruration的更多相关文章
随机推荐
- android 编译过程
引用:http://www.cnblogs.com/devinzhang/archive/2011/12/20/2294686.html http://blog.sina.com.cn/s/blog_ ...
- [转]在windows环境中使用varnish
varnish 的windows 版本下载地址: http://sourceforge.net/projects/cygvarnish/files/windows-zip-bundle/ 启动:var ...
- 一次爬虫实践学习(C#)
我们经常浏览网页,有时候看到一些精美的图片,想下载下来保存,但是太多,如果一张一张的下载,那太费时了:如果你喜欢看书,看小说,那么浏览小说网站是常有的事,但是有时候我们不能联网,比如农村老家,如果还想 ...
- [linux系统]--常用命令
1.shell实现找到当前目录以及子目录中名字包含king的文件 find ./ | grep king 2.tcpdump抓包参数 -nne分别代表什么意思 -nn:直接以 IP 及 port nu ...
- 我的Android第四章
本章需掌握 1.连接真机的过程. 2.dx指令的作用 3.adb是什么? 4.adb有什么用(有什么好处)? 5.adb的一些常用命令 1.连接真机的过程. 需要:一部Android机.usb连接线, ...
- Mysql修改字段长度
alter table '表名' modify column '列名' varchar(50);
- webstorm 配置scss的问题
第一种方法(ruby方法) 先安装ruby,在windows/system32目录下 1.先查询源是什么 gem sources 2.移除原有的源头 gem sources -r http://xxx ...
- 【前端】Node.js学习笔记
module.exports 使用方式: // File Name: hello.js function greet() {/*......*/} // 有下面这两种写法: // 1. module. ...
- Python3基础 访问列表 大于等于指定索引值的所有元素
镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ ...
- JAVA微信支付多次回调方法解决方案
@WebServlet("/ActionServlet")public class PayWxOrderingReqCBS extends HttpServlet { public ...