gzhbk

try {
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String logName = sdf.format(now);
//服务器日志地址 /data/website/zhuohuiclass/cloud/logs/
File logFile = new File("E:\\foen_api\\foen_api_log\\logs\\", logName+".txt");
if (!logFile.exists()) {
//logFile.mkdirs();
logFile.createNewFile();
}
if(StringUtils.isBlank("")){

}
//数据分析用 用户编号 IP 方法 时间
String data =userName+"\t"+ip+"\t"+remark+"\t"+responseTime+"\t"+"\r\n";
FileOutputStream out = new FileOutputStream(logFile,true);
out.write(data.getBytes());
out.close();
}catch (Exception e){
logger.error("==> 日志异常");
}

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-08-16
  • 2022-12-23
  • 2021-12-20
  • 2021-11-02
  • 2021-12-29
猜你喜欢
  • 2021-06-18
  • 2021-06-16
  • 2021-11-02
  • 2021-09-23
  • 2021-03-31
  • 2021-11-12
相关资源
相似解决方案