Commit a5ecf13e authored by 张永's avatar 张永

V1.1.7.4

parent 83e1b04a
...@@ -99,20 +99,13 @@ public class IDCSystemLogAspect { ...@@ -99,20 +99,13 @@ public class IDCSystemLogAspect {
@Async @Async
void syncSaveLog(ProceedingJoinPoint joinPoint, Date startTime, Date endTime, void syncSaveLog(ProceedingJoinPoint joinPoint, Date startTime, Date endTime,
String exception, String result, int statusCode) { String exception, String result, int statusCode) {
//TIdcServicesLogs log = new TIdcServicesLogs();
Map<String,Object> logMap = new HashMap<String,Object>(); Map<String,Object> logMap = new HashMap<String,Object>();
//log.setsChannel(serverShopName);
logMap.put("sChannel", serverShopName); logMap.put("sChannel", serverShopName);
try { try {
//获取请求参数,不通过 joinPoint.getArgs() 获取。 //获取请求参数,不通过 joinPoint.getArgs() 获取。
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
if (request != null) { if (request != null) {
/* log.setsUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
log.setsHttpMethod(request.getMethod());
log.setsIp(ShopUtil.getIpAddress(request));
log.setsRequestText(GsonUtil.toJson(ShopUtil.getParameterMap(request)));*/
logMap.put("sUserAgent", request.getHeader(HttpHeaders.USER_AGENT)); logMap.put("sUserAgent", request.getHeader(HttpHeaders.USER_AGENT));
logMap.put("sHttpMethod", request.getMethod()); logMap.put("sHttpMethod", request.getMethod());
logMap.put("sIp", ShopUtil.getIpAddress(request)); logMap.put("sIp", ShopUtil.getIpAddress(request));
...@@ -125,21 +118,10 @@ public class IDCSystemLogAspect { ...@@ -125,21 +118,10 @@ public class IDCSystemLogAspect {
IDCLogResource annotation = method.getAnnotation(IDCLogResource.class); IDCLogResource annotation = method.getAnnotation(IDCLogResource.class);
if (annotation != null) { if (annotation != null) {
//注解上的描述 //注解上的描述
//log.setsName(annotation.name());
logMap.put("sName", annotation.name()); logMap.put("sName", annotation.name());
} }
/* System.out.println("aop 获取目标方法名 "+joinPoint.getSignature().getName());
System.out.println("aop 获取目标方法所属类的简单类名 "+joinPoint.getSignature().getDeclaringType().getName());
System.out.println("aop 返回 "+result);*/
/* log.setsClassName(joinPoint.getSignature().getDeclaringType().getName());
log.setsFunctionName(joinPoint.getSignature().getName());
log.setdStartTime(startTime);
log.setdEndTime(endTime);
log.setsCreateUser("aop");*/
logMap.put("sClassName", joinPoint.getSignature().getDeclaringType().getName()); logMap.put("sClassName", joinPoint.getSignature().getDeclaringType().getName());
logMap.put("sFunctionName", joinPoint.getSignature().getName()); logMap.put("sFunctionName", joinPoint.getSignature().getName());
...@@ -149,11 +131,9 @@ public class IDCSystemLogAspect { ...@@ -149,11 +131,9 @@ public class IDCSystemLogAspect {
//入参 //入参
Long cost = endTime.getTime() - startTime.getTime(); Long cost = endTime.getTime() - startTime.getTime();
/* log.setnCost(cost.intValue());
log.setsResponseText(result);*/
logMap.put("nCost", cost.intValue()); logMap.put("nCost", cost.intValue());
logMap.put("sResponseText", result); logMap.put("sResponseText", result);
// jdbcTemplate.saveOrUpdate(log);
logMap.put("nTag", 0); logMap.put("nTag", 0);
logMap.put("dCreateDate", new Date()); logMap.put("dCreateDate", new Date());
logMap.put("dLastUpdateTime", new Date()); logMap.put("dLastUpdateTime", new Date());
...@@ -163,5 +143,6 @@ public class IDCSystemLogAspect { ...@@ -163,5 +143,6 @@ public class IDCSystemLogAspect {
} catch (Exception e) { } catch (Exception e) {
logger.info("aop 保存日志异常:",e); logger.info("aop 保存日志异常:",e);
} }
} }
} }
...@@ -71,7 +71,7 @@ public class DataSourceConfig { ...@@ -71,7 +71,7 @@ public class DataSourceConfig {
public JdbcTemplate getLogJdbcTemplate(@Qualifier("log")DataSource dataSource) { public JdbcTemplate getLogJdbcTemplate(@Qualifier("log")DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(); JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource); jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new MySqlDialect()); jdbcTemplate.setDialect(new SqlServerDialect());
jdbcTemplate.setSql_level(3); jdbcTemplate.setSql_level(3);
return jdbcTemplate; return jdbcTemplate;
} }
......
...@@ -40,11 +40,13 @@ spring.datasource.filters=stat,log4j ...@@ -40,11 +40,13 @@ spring.datasource.filters=stat,log4j
log.isOpen=true log.isOpen=true
log.datasource.username=ERP log.datasource.username=ERP
log.datasource.password=qiyang@2013 log.datasource.password=qiyang@2013
log.datasource.url=jdbc:mysql://10.10.0.21:3306/shopLog?useSSL=false&useUnicode=true&characterEncoding=utf8 log.datasource.url=jdbc:sqlserver://10.10.0.22:1433;instanceName=SQLSERVER;DatabaseName=LOGDB;allowMultiQueries=true
log.datasource.driver-class-name=com.mysql.cj.jdbc.Driver log.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
log.datasource.testWhileIdle=true log.datasource.testWhileIdle=true
log.datasource.validationQueryTimeout=5 log.datasource.validationQueryTimeout=5
log.datasource.validationQuery=SELECT 1 FROM DUAL log.datasource.validationQuery=SELECT 1
log.datasource.timeBetweenEvictionRunsMillis=3600000
log.datasource.filters=stat,log4j
opt.express.url=https://service-5ptj62bx-1257101137.ap-shanghai.apigateway.myqcloud.com/release/express/query opt.express.url=https://service-5ptj62bx-1257101137.ap-shanghai.apigateway.myqcloud.com/release/express/query
opt.express.secretId=AKID3dJ0MqWwN23oZ8xt4GFB0s8My1rEfUW2diLU opt.express.secretId=AKID3dJ0MqWwN23oZ8xt4GFB0s8My1rEfUW2diLU
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<body> <body>
<div id="app"> <div id="app">
<el-divider content-position="left">V1.1.7.4 2024-2-28</el-divider> <el-divider content-position="left">V1.1.7.4 2024-2-28</el-divider>
<p class="title">1.将日志写入mysql 的idcSystemLog,一天一表: idcSystemLog_yyyyMMdd</p> <p class="title">1.将日志写入SqlServer LGODB的idcSystemLog,一天一表: idcSystemLog_yyyyMMdd</p>
<el-divider content-position="left">V1.1.7.3 2024-2-27</el-divider> <el-divider content-position="left">V1.1.7.3 2024-2-27</el-divider>
<p class="title">1.增加开关,是否写idcSystemLog表</p> <p class="title">1.增加开关,是否写idcSystemLog表</p>
<el-divider content-position="left">V1.1.7.2 2024-1-29</el-divider> <el-divider content-position="left">V1.1.7.2 2024-1-29</el-divider>
......
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