1:新增请求地址字段
2:修改访问swagger日志界面和行为日志界面时不记录日志
This commit is contained in:
@@ -3,7 +3,7 @@ package com.nis.domain;
|
||||
import java.util.Date;
|
||||
|
||||
public class SwaggerLog extends BaseEntity<SwaggerLog> {
|
||||
private static final long serialVersionUID = 5351369774420087482L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String operator;
|
||||
private String version;
|
||||
private Integer opAction;
|
||||
@@ -16,13 +16,13 @@ public class SwaggerLog extends BaseEntity<SwaggerLog> {
|
||||
private String exceptionInfo;
|
||||
private String serverIp;
|
||||
private String traceCode;
|
||||
private String requestUri;
|
||||
|
||||
private String exception;// 界面的异常信息框
|
||||
|
||||
private Date beginDate; // 开始日期
|
||||
private Date endDate; // 结束日期
|
||||
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
@@ -143,4 +143,12 @@ public class SwaggerLog extends BaseEntity<SwaggerLog> {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getRequestUri() {
|
||||
return requestUri;
|
||||
}
|
||||
|
||||
public void setRequestUri(String requestUri) {
|
||||
this.requestUri = requestUri;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ public class LogInterceptor extends BaseService implements HandlerInterceptor {
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws Exception {
|
||||
String requestURI = request.getRequestURI();
|
||||
// logger.info("请求路径是:" + requestURI);
|
||||
// logger.info("请求参数是:" + getBodyString(request));
|
||||
// logger.info("请求路径是:" + requestURI);
|
||||
// logger.info("请求参数是:" + getBodyString(request));
|
||||
long beginTime = System.currentTimeMillis();// 1、开始时间
|
||||
timeThreadLocal.set(beginTime); // 线程绑定变量(该数据只有当前请求的线程可见)
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -128,9 +128,13 @@ public class LogInterceptor extends BaseService implements HandlerInterceptor {
|
||||
|
||||
}
|
||||
|
||||
// 保存日志
|
||||
LogUtils.saveLog(request, handler, ex, null, consumerTime);
|
||||
|
||||
String requestURI = request.getRequestURI();
|
||||
// swagger日志请求和行为日志请求不记录请求日志
|
||||
if (!requestURI.equals("/galaxy/nis/sys/log/swaggerLogList")
|
||||
&& !requestURI.equals("/galaxy/nis/sys/log/list")) {
|
||||
// 保存日志
|
||||
LogUtils.saveLog(request, handler, ex, null, consumerTime);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#{beginDate} AND #{endDate}
|
||||
|
||||
<if test="requestContent != null and requestContent != ''">
|
||||
AND a.request_Content LIKE
|
||||
AND a.request_Content LIKE
|
||||
<if test="dbName == 'oracle'">'%'||#{requestContent}||'%'</if>
|
||||
<if test="dbName == 'mssql'">'%'+#{requestContent}+'%'</if>
|
||||
<if test="dbName == 'mysql'">CONCAT('%', #{requestContent}, '%')</if>
|
||||
@@ -18,22 +18,31 @@
|
||||
<if test="traceCode != null and traceCode != ''">
|
||||
AND a.trace_Code=#{traceCode}
|
||||
</if>
|
||||
<if test="businessCode != null and businessCode != ''">
|
||||
AND a.business_Code=#{businessCode}
|
||||
</if>
|
||||
<if test="requestUri != null and requestUri != ''">
|
||||
AND a.REQUEST_URI LIKE
|
||||
<if test="dbName == 'oracle'">'%'||#{requestUri}||'%'</if>
|
||||
<if test="dbName == 'mssql'">'%'+#{requestUri}+'%'</if>
|
||||
<if test="dbName == 'mysql'">CONCAT('%', #{requestUri}, '%')</if>
|
||||
</if>
|
||||
|
||||
<if test="exceptionInfo != null and exceptionInfo != ''">
|
||||
AND a.exception_Info LIKE
|
||||
AND a.exception_Info LIKE
|
||||
<if test="dbName == 'oracle'">'%'||#{exceptionInfo}||'%'</if>
|
||||
<if test="dbName == 'mssql'">'%'+#{exceptionInfo}+'%'</if>
|
||||
<if test="dbName == 'mysql'">CONCAT('%', #{exceptionInfo}, '%')</if>
|
||||
</if>
|
||||
|
||||
<if test="requestIp != null and requestIp != ''">
|
||||
AND a.request_ip like
|
||||
AND a.request_ip like
|
||||
<if test="dbName == 'oracle'">'%'||#{requestIp}||'%'</if>
|
||||
<if test="dbName == 'mssql'">'%'+#{requestIp}+'%'</if>
|
||||
<if test="dbName == 'mysql'">CONCAT('%', #{requestIp}, '%')</if>
|
||||
</if>
|
||||
<if test="serverIp != null and serverIp != ''">
|
||||
AND a.server_Ip like
|
||||
AND a.server_Ip like
|
||||
<if test="dbName == 'oracle'">'%'||#{serverIp}||'%'</if>
|
||||
<if test="dbName == 'mssql'">'%'+#{serverIp}+'%'</if>
|
||||
<if test="dbName == 'mysql'">CONCAT('%', #{serverIp}, '%')</if>
|
||||
|
||||
Reference in New Issue
Block a user