Commit 40e2aeca authored by 郝彦辉's avatar 郝彦辉

完善日志输出

parent 4a31a5be
......@@ -446,11 +446,12 @@ public class IReportServiceImpl implements ReportService {
log.info("[preparedMap]: \n" + utils.map2Json(preparedMap));
// 构造header
Map<String, String> headerMap = getHeaderMap(preparedMap);
log.info("[header]: \n" + utils.map2Json(headerMap));
log.info("查看报送状态入参, [header]: \n" + utils.map2Json(headerMap));
try {
resp = taskJerseyClient.post(headerMap, null, reportConfig.getTaskUri());
} catch (Exception e) {
log.error("查看 fileName: {} ,异常e: {} ", fileEntry.getFileName(), e);
//log.error("查看 fileName: {} ,异常e: {} ", fileEntry.getFileName(), e);
log.error("查看报送状态接口异常, fileName: {} ", fileEntry.getFileName(), e);
throw new QgException(fileEntry.getFileName() + "查看报送状态接口异常", e);
}
if (resp.getStatus() == 200) {
......@@ -464,7 +465,7 @@ public class IReportServiceImpl implements ReportService {
* 存在入库失败的数据,见tmp/test.txt
*/
String responseString = resp.getEntity(String.class);
log.info("查询报送任务是否入库结束: {} ", responseString);
log.info("查看报送状态结束200, fileName: {} , entity: {} ", fileEntry.getFileName(), responseString);
JSONObject json = JSON.parseObject(responseString);
// 如果有反馈文件 说明有数据未成功入库
// 反馈报文保存为txt文件
......@@ -504,12 +505,7 @@ public class IReportServiceImpl implements ReportService {
}
}
} else {
log.error("报送状态查询接口失败, Status: {} , fileName: {} ", resp.getStatus(), fileEntry.getFileName());
try{
log.info("报送状态查询接口失败, entity="+resp.getEntity(String.class));
}catch (Exception e){
log.error("报送状态查询接口失败, 读取getEntity异常", e);
}
log.error("报送状态查询接口失败, fileName: {} , Status: {} , entity: {} ", fileEntry.getFileName(), resp.getStatus(), resp.getEntity(String.class));
//log.info("[ERROR] Status: " + resp.getStatus());
// log.info(resp.getEntity(String.class));
throw new QgException("报送状态查询接口失败", "http 状态="+resp.getStatus()+", fileName="+fileEntry.getFileName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment