写入日志
来源:互联网 发布:java发短信 编辑:程序博客网 时间:2024/05/17 06:37
/**
* 写入日志
* filePath 日志文件的路径
* code 要写入日志文件的内容
*/
public static boolean print(String filePath,String code) {
try {
File tofile=new File(filePath);
FileWriter fw=new FileWriter(tofile,true);
BufferedWriter bw=new BufferedWriter(fw);
PrintWriter pw=new PrintWriter(bw);
System.out.println(getDate()+":"+code);
pw.println(getDate()+":"+code);
pw.close();
bw.close();
fw.close();
return true;
} catch (IOException e) {
return false;
}
}
* 写入日志
* filePath 日志文件的路径
* code 要写入日志文件的内容
*/
public static boolean print(String filePath,String code) {
try {
File tofile=new File(filePath);
FileWriter fw=new FileWriter(tofile,true);
BufferedWriter bw=new BufferedWriter(fw);
PrintWriter pw=new PrintWriter(bw);
System.out.println(getDate()+":"+code);
pw.println(getDate()+":"+code);
pw.close();
bw.close();
fw.close();
return true;
} catch (IOException e) {
return false;
}
}
- 写入日志
- 业务日志之日志写入
- 写入日志文件
- 写入应用程序日志
- 错误写入日志
- 写入事件日志中
- java写入日志文件
- 写入日志文件
- log4j日志写入数据库
- log4j日志写入数据库
- Java 自定义日志写入
- c# 写入异常日志
- Log4Net 写入日志文件
- yii 2.0 写入日志
- yii 2.0 写入日志
- io写入日志
- yii 2.0 写入日志
- 写入错误日志
- 文件命名
- 文件大小单位转换
- 将源文件拷贝到目标文件
- Unicode编码及UCS、UTF、BMP、BOM等名词释义
- 判断任意一个整数是否素数
- 写入日志
- 小排序
- 用半角的特殊符号代替全角的特殊符号
- 分割字符串
- 字符串操作
- 泛型分布式应用_数据访问类
- 字符串匹配的算法
- 泛型分布式应用_业务类
- 泛型分布式应用_实例