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的更多相关文章
随机推荐
- .NET组件控件实例编程系列——5.DataGridView数值列和日期列
在使用DataGridView编辑数据的时候,编辑的单元格一般会显示为文本框,逻辑值和图片会自动显示对应类型的列.当然我们自己可以手工选择列的类型,例如ComboBox列.Button列.Link列. ...
- 如何申请国际版Office365和Azure的试用账号
关键字:国际版.Office365.Azure.试用账号.1美元.信用卡 待续
- C# 把背景为白色的图片变成透明图片
Image Imageimage; Imageimage = System.Drawing.Image.FromFile(@"C:\A.JPG"); Bitmap bitmap = ...
- 读书笔记 --TCP :传输控制协议(二)
TCP建立连接 请求端(客户端)发送一个SYN指明客户端打算连接的服务器端口号,以及初始序列号. 服务端发回包含服务器的初始序号的SYN报文段作为应答.同时,将确认序号设置为客户的ISN加1以对客户的 ...
- HTTP请求 GET与POST是怎么实现?
1.HTTP请求格式: <request line> <headers> <blank line> [<request-body>] 在HTTP请求中, ...
- 在Ubuntu Server下配置LAMP环境
1. 下载Ubuntu Server,地址https://www.ubuntu.com/download/server 2. 在虚拟机上安装Ubuntu Server.根据安装引导过程一步步安装,跟在 ...
- 瘋子C++笔记
瘋耔C++笔记 欢迎关注瘋耔新浪微博:http://weibo.com/cpjphone 参考:C++程序设计(谭浩强) 参考:http://c.biancheng.net/cpp/biancheng ...
- js 两个滚动事件相互影响
document.addEventListener('scroll', function(event) { if (event.target.id === 't_r_content') { // or ...
- GDUFE-OJ 1203x的y次方的最后三位数 快速幂
嘿嘿今天学了快速幂也~~ Problem Description: 求x的y次方的最后三位数 . Input: 一个两位数x和一个两位数y. Output: 输出x的y次方的后三位数. Sample ...
- 5分钟开启Esper之旅
原作者:CoffeeOneSugar 翻译:刘斌华 在我之前发表的文章中,我提到我最近热衷于Complex Event Processing (CEP) (复杂事件处理).简单来说,CEP把数据流作为 ...