标题日志的打印
public void saveLog(Exception e) throws Exception {
String path = Constant.BASE_UPLOAD_PATH + File.separator + "LogFile";
File pathDir = new File(path);
//创建本地目录
if(!pathDir.exists()){
pathDir.mkdirs();
}
StringBuffer sb=new StringBuffer();
FileWriter fw=new FileWriter(pathDir+File.separator + UUID.randomUUID()+".txt");
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);//将出错的栈信息输出到printWriter中
pw.flush();
sw.flush();
String s = sw.toString();
sb.append(s);
fw.write(sb.toString());
fw.close();
}