1、对原始日志查询开始时间和结束时间两个查询条件的日期格式在验证时进行严格解析;

2、为请求日志service_request_log添加request_uri字段;
This commit is contained in:
zhangdongxu
2018-08-08 10:52:53 +08:00
parent c02eb6fc3a
commit 35709dedbf
4 changed files with 26 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ public class ServicesRequestLog implements Serializable {
private String exceptionInfo; private String exceptionInfo;
private String serverIp; private String serverIp;
private String traceCode; private String traceCode;
private String requestURI;
/** /**
* serverIp * serverIp
@@ -224,4 +225,17 @@ public class ServicesRequestLog implements Serializable {
this.traceCode = traceCode; this.traceCode = traceCode;
} }
/**
* @param requestURI the requestURI to set
*/
public void setRequestURI(String requestURI) {
this.requestURI = requestURI;
}
/**
* @return the requestURI
*/
public String getRequestURI() {
return requestURI;
}
} }

View File

@@ -15,11 +15,12 @@
<result column="EXCEPTION_INFO" jdbcType="BLOB" property="exceptionInfo" typeHandler="com.nis.util.BlobTypeHandler"/> <result column="EXCEPTION_INFO" jdbcType="BLOB" property="exceptionInfo" typeHandler="com.nis.util.BlobTypeHandler"/>
<result column="SERVER_IP" jdbcType="VARCHAR" property="serverIp" /> <result column="SERVER_IP" jdbcType="VARCHAR" property="serverIp" />
<result column="TRACE_CODE" jdbcType="VARCHAR" property="traceCode" /> <result column="TRACE_CODE" jdbcType="VARCHAR" property="traceCode" />
<result column="REQUEST_URI" jdbcType="VARCHAR" property="requestURI" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
ID, OPERATOR, VERSION, OPACTION,OPTIME, REQUEST_CONTENT, ID, OPERATOR, VERSION, OPACTION,OPTIME, REQUEST_CONTENT,
REQUEST_TIME,REQUEST_IP, REQUEST_TIME,REQUEST_IP,
CONSUMER_TIME,BUSINESS_CODE,EXCEPTION_INFO,SERVER_IP,TRACE_CODE CONSUMER_TIME,BUSINESS_CODE,EXCEPTION_INFO,SERVER_IP,TRACE_CODE,REQUEST_URI
</sql> </sql>
<select id="getAllLog" parameterType="com.nis.domain.restful.ServicesRequestLogBean" <select id="getAllLog" parameterType="com.nis.domain.restful.ServicesRequestLogBean"
resultMap="ServicesRequestLogMap"> resultMap="ServicesRequestLogMap">
@@ -127,6 +128,10 @@
<if test="traceCode != null"> <if test="traceCode != null">
TRACE_CODE, TRACE_CODE,
</if> </if>
<if test="requestURI != null">
REQUEST_URI,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -166,6 +171,9 @@
<if test="traceCode != null"> <if test="traceCode != null">
#{traceCode,jdbcType=VARCHAR}, #{traceCode,jdbcType=VARCHAR},
</if> </if>
<if test="requestURI != null">
#{requestURI,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
</mapper> </mapper>

View File

@@ -186,6 +186,7 @@ public abstract class BaseLogService {
try { try {
if (!StringUtil.isBlank(entity.getSearchFoundEndTime())) { if (!StringUtil.isBlank(entity.getSearchFoundEndTime())) {
sdf.setLenient(false);
sdf.parse(entity.getSearchFoundEndTime()); sdf.parse(entity.getSearchFoundEndTime());
} }
} catch (ParseException e) { } catch (ParseException e) {
@@ -201,6 +202,7 @@ public abstract class BaseLogService {
try { try {
if (!StringUtil.isBlank(entity.getSearchFoundStartTime())) { if (!StringUtil.isBlank(entity.getSearchFoundStartTime())) {
sdf.setLenient(false);
sdf.parse(entity.getSearchFoundStartTime()); sdf.parse(entity.getSearchFoundStartTime());
} }
} catch (ParseException e) { } catch (ParseException e) {

View File

@@ -105,6 +105,7 @@ public class ServicesRequestLogService {
log.setBusinessCode(businessCode); log.setBusinessCode(businessCode);
log.setExceptionInfo(exceptionInfo); log.setExceptionInfo(exceptionInfo);
log.setTraceCode(traceCode); log.setTraceCode(traceCode);
log.setRequestURI(requestURI);
try { try {
if(Constants.SERVCER_HOST!=null){ if(Constants.SERVCER_HOST!=null){
log.setServerIp(Constants.SERVCER_HOST); log.setServerIp(Constants.SERVCER_HOST);