博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
将字符串写入磁盘
阅读量:4290 次
发布时间:2019-05-27

本文共 576 字,大约阅读时间需要 1 分钟。

private void writeMessageToDisk(String returnJson) {
try {
String beforePath = Config.getContextRealPath() + "monitorLog/";
String savePath = beforePath + "express.txt";
File file = new File(beforePath);
if (!file.exists()) {
file.mkdirs();
}
OutputStreamWriter write = new OutputStreamWriter(
new FileOutputStream(savePath, true), "gbk");
BufferedWriter writer = new BufferedWriter(write);
writer.write(new Date() + "------" + returnJson + "\t\n");
writer.close();
} catch (Exception e) {
System.out.println("****************写入错误******************");
e.printStackTrace();
}
}

转载地址:http://uwqgi.baihongyu.com/

你可能感兴趣的文章
单链表是否有环的问题
查看>>
判断两个链表是否相交并找出交点
查看>>
归并排序
查看>>
STL常见问题
查看>>
time_wait和close_wait状态
查看>>
STL中vector、list、deque和map的区别
查看>>
Linux下多线程查看工具(pstree、ps、pstack)
查看>>
PID PPID LWP NLWP
查看>>
查看线程CPU占用情况
查看>>
查看个线程的CPU 内存占用
查看>>
Fiddler 教程
查看>>
apache 设置用户注意事项
查看>>
svn中设置文件夹链接
查看>>
find ./ -name "*.cgi" |xargs -i cp "{}" ./cgi-bin/
查看>>
svn st | awk '{if ( $1 == "?") { print $2}}' | xargs svn add
查看>>
mysql事务处理用法与实例详解
查看>>
利用iptables来配置linux禁止所有端口登陆和开放指定端口
查看>>
Python模块——struct
查看>>
mysql中select * for update
查看>>
linux vmstat 1 ,watch , pmap -p,
查看>>