| | |
| | | @Value("${spring.profiles.active}") |
| | | private String profiles; |
| | | |
| | | @Value("${app.project}") |
| | | private String projectName; |
| | | |
| | | @Pointcut("execution(* com.xcong.excoin..*.*(..))") |
| | | public void exceptionCatch() { |
| | | } |
| | |
| | | throw ex; |
| | | } |
| | | |
| | | if ("dev".equals(profiles) || "test".equals(profiles)) { |
| | | throw ex; |
| | | } |
| | | |
| | | SysExceptionDetailEntity exceptionData = new SysExceptionDetailEntity(); |
| | | String exStr = printStackTraceToString(ex); |
| | | ThreadPoolUtils.EXECUTOR.execute(new Runnable(){ |
| | |
| | | try { |
| | | log.info("插入"); |
| | | exceptionData.setCreateTime(new Date()); |
| | | exceptionData.setMachine(InetAddress.getLocalHost().getHostName() + "-" + profiles); |
| | | exceptionData.setMachine(projectName + "-" +InetAddress.getLocalHost().getHostName() + "-" + profiles); |
| | | exceptionData.setAddress(InetAddress.getLocalHost().getHostAddress()); |
| | | exceptionData.setExceptionMsg(exStr); |
| | | exceptionData.setSimpleMsg(ex.getMessage()); |