diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 27d6516..e7becb3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -119,6 +119,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //车号 int carno = arr[20]; logService.deviceExecuteLog(this.device_code, "", "", "接收agv上报信息:" + "phase--" + phase + " index--" + index + " 指令号--" + ikey + " 站点号--" + agvaddr + " 车号--" + carno); + log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "接收agv上报信息:" + "phase--" + phase + " index--" + index + " 指令号--" + ikey + " 站点号--" + agvaddr + " 车号--" + carno)); Instruction link_inst = null; List insts = null; @@ -176,15 +177,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic inst.setCarno(String.valueOf(carno)); instructionService.update(inst); logService.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈车号:" + carno + ",指令号:" + ikey); + log.info("{},{}", device_code, "agvphase:" + phase + "反馈车号:" + carno + ",指令号:" + ikey); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agvphase:" + phase + "反馈车号:" + carno + ",指令号:" + ikey)); //到达取货点 //(需要WCS反馈) } else if (phase == 0x03) { log.info("==================AGV请求取货=================="); - if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logService.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); + log.info("{},{}", device_code, "未找到指令 [" + ikey + "]"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到指令 [" + ikey + "]")); return; } @@ -193,6 +195,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } if (agvaddr < 1) { logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); + log.info("{},{}", device_code, "agv地址参数有误,phase:" + phase); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); return; } @@ -223,6 +226,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic log.info("未找到编号{}对应的指令", ikey); agv_message = "未找到编号"+ikey +"对应的指令"; logService.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); + log.info("{},{}", device_code, "未找到关联编号对应的指令" + ikey); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到关联编号对应的指令" + ikey)); return; } @@ -258,6 +262,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -292,6 +297,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshStationDeviceDriver.setMessage(message); agv_message = lnshStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -326,6 +332,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorPressStationDeviceDriver.setMessage(message); agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -344,6 +351,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic flag = true; } else { logService.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}无货,无法反馈"); + log.info("{},{}", device_code,"AGV请求取货设备{}无货,无法反馈"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "AGV请求取货设备{}无货,无法反馈")); } } @@ -372,6 +380,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorBarcodeDeviceDriver.setMessage(message); agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -408,6 +417,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic agv_device.setStatus_message(agv_message); lnshFoldDiscSiteDeviceDriver.setMessage(message); logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -425,6 +435,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (flag) { log.info("==================允许AGV取货=================="); logService.deviceExecuteLog(device_code, "", "", "允许AGV取货。"); + log.info("{},{}", device_code,"允许AGV取货。"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV取货。")); } //取货完毕 @@ -434,6 +445,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logService.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); + log.info("{},{}", device_code,"未找到指令 [" + ikey + "]"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到指令 [" + ikey + "]")); return; } @@ -442,6 +454,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } if (agvaddr < 1) { logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); + log.info("{},{}", device_code,"agv地址参数有误,phase:" + phase); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); return; } @@ -463,6 +476,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isEmpty(device_code)) { log.info(agvaddr + "对应设备号为空!"); logService.deviceExecuteLog(this.device_code, "", "", "对应设备号为空" + device_code); + log.info("{},{}", device_code,"对应设备号为空" + device_code); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "对应设备号为空" + device_code)); return; } @@ -470,6 +484,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isEmpty(inst)) { log.info("未找到关联编号{}对应的指令", ikey); logService.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); + log.info("{},{}", device_code,"未找到关联编号对应的指令" + ikey); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到关联编号对应的指令" + ikey)); return; } @@ -502,6 +517,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -534,6 +550,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshStationDeviceDriver.setMessage(message); agv_message = lnshStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -566,6 +583,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorPressStationDeviceDriver.setMessage(message); agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -611,6 +629,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorBarcodeDeviceDriver.setMessage(message); agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -643,6 +662,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshFoldDiscSiteDeviceDriver.setMessage(message); agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -663,6 +683,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } if (ObjectUtil.isNotEmpty(data)) { logService.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); + log.info("{},{}", device_code,"agvphase:" + phase + "反馈:" + Bytes2HexString(data)); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agvphase:" + phase + "反馈:" + Bytes2HexString(data))); } // if (flag) { @@ -684,6 +705,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (flag) { log.info("================允许AGV取货后离开================="); logService.deviceExecuteLog(device_code, "", "", "允许AGV取货后离开。"); + log.info("{},{}", device_code,"允许AGV取货后离开。"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV取货后离开。")); } //到达放货点 @@ -693,6 +715,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logService.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); + log.info("{},{}", device_code,"未找到指令 [" + ikey + "]"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到指令 [" + ikey + "]")); return; } @@ -701,6 +724,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } if (agvaddr < 1) { logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); + log.info("{},{}", device_code,"agv地址参数有误,phase:" + phase); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); return; } @@ -759,6 +783,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -794,6 +819,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshStationDeviceDriver.setMessage(message); agv_message = lnshStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -829,6 +855,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorPressStationDeviceDriver.setMessage(message); agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -871,6 +898,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorBarcodeDeviceDriver.setMessage(message); agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -907,6 +935,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshFoldDiscSiteDeviceDriver.setMessage(message); agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -926,6 +955,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (flag) { log.info("==================允许AGV放货=================="); logService.deviceExecuteLog(device_code, "", "", "允许AGV放货。"); + log.info("{},{}", device_code,"允许AGV放货。"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV放货。")); } @@ -936,6 +966,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logService.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); + log.info("{},{}", "未找到指令号对应的指令:",String.valueOf(ikey)); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, String.valueOf(ikey))); return; } @@ -944,6 +975,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } if (agvaddr < 1) { logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); + log.info("{},{}", device_code,"agv地址参数有误,phase:" + phase); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); return; } @@ -999,6 +1031,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -1030,6 +1063,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshStationDeviceDriver.setMessage(message); agv_message = lnshStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -1076,6 +1110,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorPressStationDeviceDriver.setMessage(message); agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -1124,6 +1159,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; conveyorBarcodeDeviceDriver.setMessage(message); logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } @@ -1156,12 +1192,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic lnshFoldDiscSiteDeviceDriver.setMessage(message); agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; logService.deviceExecuteLog(device_code, "", "", message); + log.info("{},{}", device_code,message); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); } } if (flag) { log.info("================允许AGV放货后离开================="); logService.deviceExecuteLog(device_code, "", "", "允许AGV放货后离开。"); + log.info("{},{}", device_code,"允许AGV放货后离开。"); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV放货后离开。")); } } @@ -1207,6 +1245,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (!ObjectUtil.isEmpty(data)) { phase = 0; logService.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); + log.info("{},{}", device_code,"agvphase:" + phase + "反馈:" + Bytes2HexString(data)); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agvphase:" + phase + "反馈:" + Bytes2HexString(data))); NDCSocketConnectionAutoRun.write(data); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java index 6cb5dc0..3f3cc1b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/log/service/impl/DeviceExecuteLogServiceImpl.java @@ -31,7 +31,7 @@ public class DeviceExecuteLogServiceImpl implements DeviceExecuteLogService { public void deviceExecuteLog(String device_code, String vehicle_code, String inst_code, String message) { try { MDC.put("device_code_log", device_code); - log.info("{} - {}", device_code, message); + log.info("{},{}", device_code, message); } catch (Throwable t) { log.error("设备日志报错", t); } finally { diff --git a/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml b/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml index 6f4e7ce..f4629cd 100644 --- a/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml +++ b/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml @@ -6,7 +6,7 @@ - ${LOG_HOME}/AGVNDC交互/%d{yyyy-MM-dd}.%i.log + ${LOG_HOME}/AGV驱动与NDC交互/%d{yyyy-MM-dd}.%i.log 15 diff --git a/acs/nladmin-system/src/main/resources/log/NDCAgvServiceImpl.xml b/acs/nladmin-system/src/main/resources/log/NDCAgvServiceImpl.xml index 76e6024..a10d776 100644 --- a/acs/nladmin-system/src/main/resources/log/NDCAgvServiceImpl.xml +++ b/acs/nladmin-system/src/main/resources/log/NDCAgvServiceImpl.xml @@ -1,14 +1,33 @@ + + + + + + + + ${LOG_HOME}/NDCAGV服务/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + ${log.charset} + - - - - - + - + - + + + + + diff --git a/acs/nladmin-system/src/main/resources/logback-spring.xml b/acs/nladmin-system/src/main/resources/logback-spring.xml index bad90ee..85bbca8 100644 --- a/acs/nladmin-system/src/main/resources/logback-spring.xml +++ b/acs/nladmin-system/src/main/resources/logback-spring.xml @@ -27,6 +27,7 @@ https://juejin.cn/post/6844903775631572999 +