Merge branch 'Release-1.1' into develop
This commit is contained in:
@@ -73,9 +73,7 @@ public class Page<T> {
|
|||||||
* @param response 用于设置 Cookie,记住页码
|
* @param response 用于设置 Cookie,记住页码
|
||||||
*/
|
*/
|
||||||
public Page(HttpServletRequest request, HttpServletResponse response){
|
public Page(HttpServletRequest request, HttpServletResponse response){
|
||||||
|
this(request, response,Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
||||||
//this(request, response,Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 构造方法
|
* 构造方法
|
||||||
|
|||||||
154
src/main/java/com/nis/domain/SwaggerLog.java
Normal file
154
src/main/java/com/nis/domain/SwaggerLog.java
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
package com.nis.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class SwaggerLog extends BaseEntity<SwaggerLog> {
|
||||||
|
private static final long serialVersionUID = 5351369774420087482L;
|
||||||
|
private Long id;
|
||||||
|
private String operator;
|
||||||
|
private String version;
|
||||||
|
private Integer opAction;
|
||||||
|
private Date opTime;
|
||||||
|
private String requestContent;
|
||||||
|
private Date requestTime;
|
||||||
|
private Long consumerTime;
|
||||||
|
private String requestIp;
|
||||||
|
private Integer businessCode;
|
||||||
|
private String exceptionInfo;
|
||||||
|
private String serverIp;
|
||||||
|
private String traceCode;
|
||||||
|
|
||||||
|
private String exception;// 界面的异常信息框
|
||||||
|
|
||||||
|
private Date beginDate; // 开始日期
|
||||||
|
private Date endDate; // 结束日期
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOperator() {
|
||||||
|
return operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperator(String operator) {
|
||||||
|
this.operator = operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOpAction() {
|
||||||
|
return opAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpAction(Integer opAction) {
|
||||||
|
this.opAction = opAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getOpTime() {
|
||||||
|
return opTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpTime(Date opTime) {
|
||||||
|
this.opTime = opTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequestContent() {
|
||||||
|
return requestContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestContent(String requestContent) {
|
||||||
|
this.requestContent = requestContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRequestTime() {
|
||||||
|
return requestTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestTime(Date requestTime) {
|
||||||
|
this.requestTime = requestTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getConsumerTime() {
|
||||||
|
return consumerTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConsumerTime(Long consumerTime) {
|
||||||
|
this.consumerTime = consumerTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequestIp() {
|
||||||
|
return requestIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestIp(String requestIp) {
|
||||||
|
this.requestIp = requestIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBusinessCode() {
|
||||||
|
return businessCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusinessCode(Integer businessCode) {
|
||||||
|
this.businessCode = businessCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExceptionInfo() {
|
||||||
|
return exceptionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExceptionInfo(String exceptionInfo) {
|
||||||
|
this.exceptionInfo = exceptionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServerIp() {
|
||||||
|
return serverIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServerIp(String serverIp) {
|
||||||
|
this.serverIp = serverIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTraceCode() {
|
||||||
|
return traceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTraceCode(String traceCode) {
|
||||||
|
this.traceCode = traceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getException() {
|
||||||
|
return exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setException(String exception) {
|
||||||
|
this.exception = exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getBeginDate() {
|
||||||
|
return beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeginDate(Date beginDate) {
|
||||||
|
this.beginDate = beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(Date endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -153,7 +153,7 @@ public class SQLHelper {
|
|||||||
*/
|
*/
|
||||||
public static Long getCount(final String sql, final Connection connection, final MappedStatement mappedStatement,
|
public static Long getCount(final String sql, final Connection connection, final MappedStatement mappedStatement,
|
||||||
final Object parameterObject, final BoundSql boundSql, Log log) throws SQLException {
|
final Object parameterObject, final BoundSql boundSql, Log log) throws SQLException {
|
||||||
logger.info("count查询开始----"+System.currentTimeMillis());
|
logger.info("开始count查询----"+System.currentTimeMillis());
|
||||||
String dbName = getDBType();
|
String dbName = getDBType();
|
||||||
final String countSql;
|
final String countSql;
|
||||||
if ("oracle".equals(dbName)) {
|
if ("oracle".equals(dbName)) {
|
||||||
@@ -194,7 +194,7 @@ public class SQLHelper {
|
|||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
} finally {
|
} finally {
|
||||||
logger.info("oracle查询count结束----"+System.currentTimeMillis());
|
logger.info("count查询结束----"+System.currentTimeMillis());
|
||||||
if (rs != null) {
|
if (rs != null) {
|
||||||
rs.close();
|
rs.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,12 +151,11 @@ public class HiveJDBC {
|
|||||||
for (int i = 1; i <= metaData.getColumnCount(); i++) {
|
for (int i = 1; i <= metaData.getColumnCount(); i++) {
|
||||||
Object value = rs.getObject(i);
|
Object value = rs.getObject(i);
|
||||||
String filedName = filedAndColumnMap.get(metaData.getColumnName(i).toString().toLowerCase());
|
String filedName = filedAndColumnMap.get(metaData.getColumnName(i).toString().toLowerCase());
|
||||||
if (null != value) {
|
if (!StringUtil.isEmpty(value)) {
|
||||||
|
//如果是日期类型的属性需要把时间戳转换成日期,如果时间戳为0直接把值设置为null
|
||||||
if (null != columnList && columnList.contains(filedName.toLowerCase())) {
|
if (null != columnList && columnList.contains(filedName.toLowerCase())) {
|
||||||
long time = 0l;
|
long time = 0l;
|
||||||
if (null != value && !value.toString().equals("")) {
|
time = Long.parseLong(value.toString());
|
||||||
time = Long.parseLong(value.toString());
|
|
||||||
}
|
|
||||||
map.put(filedName, time==0l?null:new Date(time * 1000));
|
map.put(filedName, time==0l?null:new Date(time * 1000));
|
||||||
// map.put(filedName, new
|
// map.put(filedName, new
|
||||||
// Date(Long.parseLong("1476583810000")));
|
// Date(Long.parseLong("1476583810000")));
|
||||||
@@ -236,7 +235,7 @@ public class HiveJDBC {
|
|||||||
String fieldTypeName = propertyDescriptor.getPropertyType().getName();
|
String fieldTypeName = propertyDescriptor.getPropertyType().getName();
|
||||||
if (map.containsKey(name)) {
|
if (map.containsKey(name)) {
|
||||||
Object value = map.get(name);
|
Object value = map.get(name);
|
||||||
if (null != value && !value.equals("")) {
|
if (!StringUtil.isEmpty(value)) {
|
||||||
if (fieldTypeName.equals("java.lang.String")) {
|
if (fieldTypeName.equals("java.lang.String")) {
|
||||||
propertyDescriptor.getWriteMethod().invoke(obj, new String[] { value.toString() });
|
propertyDescriptor.getWriteMethod().invoke(obj, new String[] { value.toString() });
|
||||||
} else if (fieldTypeName.equals("java.lang.Integer")) {
|
} else if (fieldTypeName.equals("java.lang.Integer")) {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.nis.web.service.LogService;
|
|||||||
import com.nis.web.service.MenuService;
|
import com.nis.web.service.MenuService;
|
||||||
import com.nis.web.service.OfficeService;
|
import com.nis.web.service.OfficeService;
|
||||||
import com.nis.web.service.RoleService;
|
import com.nis.web.service.RoleService;
|
||||||
|
import com.nis.web.service.SwaggerLogService;
|
||||||
import com.nis.web.service.SystemService;
|
import com.nis.web.service.SystemService;
|
||||||
import com.nis.web.service.UserService;
|
import com.nis.web.service.UserService;
|
||||||
|
|
||||||
@@ -50,6 +51,9 @@ public class BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected LogService logService;
|
protected LogService logService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected SwaggerLogService swaggerLogService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ArchiveServcie archiveServcie;
|
protected ArchiveServcie archiveServcie;
|
||||||
|
|
||||||
|
|||||||
@@ -9,19 +9,28 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.SwaggerLog;
|
||||||
import com.nis.domain.SysLog;
|
import com.nis.domain.SysLog;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/sys/log")
|
@RequestMapping("${adminPath}/sys/log")
|
||||||
public class SysLogController extends BaseController {
|
public class SysLogController extends BaseController {
|
||||||
|
|
||||||
@RequiresPermissions("sys:log:view")
|
@RequiresPermissions("sys:log:view")
|
||||||
@RequestMapping(value = {"list", ""})
|
@RequestMapping(value = "list")
|
||||||
public String list(SysLog sysLog, HttpServletRequest request, HttpServletResponse response, Model model) {
|
public String list(SysLog sysLog, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||||
Page<SysLog> page = logService.findPage(new Page<SysLog>(request, response), sysLog);
|
Page<SysLog> page = logService.findPage(new Page<SysLog>(request, response), sysLog);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
return "/sys/logList";
|
return "/sys/logList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("sys:swaggerLogList:view")
|
||||||
|
@RequestMapping(value = "swaggerLogList")
|
||||||
|
public String swaggerLogList(SwaggerLog sysLog, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||||
|
Page<SwaggerLog> page = swaggerLogService.findSwaggerLogPage(new Page<SwaggerLog>(request, response), sysLog);
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
return "/sys/swaggerLogList";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
7
src/main/java/com/nis/web/dao/SwaggerLogDao.java
Normal file
7
src/main/java/com/nis/web/dao/SwaggerLogDao.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package com.nis.web.dao;
|
||||||
|
|
||||||
|
import com.nis.domain.SwaggerLog;
|
||||||
|
@MyBatisDao
|
||||||
|
public interface SwaggerLogDao extends CrudDao<SwaggerLog>{
|
||||||
|
|
||||||
|
}
|
||||||
49
src/main/java/com/nis/web/dao/SwaggerLogDao.xml
Normal file
49
src/main/java/com/nis/web/dao/SwaggerLogDao.xml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.nis.web.dao.SwaggerLogDao">
|
||||||
|
|
||||||
|
<select id="findList" resultType="swaggerLog">
|
||||||
|
SELECT
|
||||||
|
a.*
|
||||||
|
FROM services_request_log a
|
||||||
|
WHERE a.request_time BETWEEN
|
||||||
|
#{beginDate} AND #{endDate}
|
||||||
|
|
||||||
|
<if test="requestContent != null and requestContent != ''">
|
||||||
|
AND a.request_Content LIKE
|
||||||
|
<if test="dbName == 'oracle'">'%'||#{requestContent}||'%'</if>
|
||||||
|
<if test="dbName == 'mssql'">'%'+#{requestContent}+'%'</if>
|
||||||
|
<if test="dbName == 'mysql'">CONCAT('%', #{requestContent}, '%')</if>
|
||||||
|
</if>
|
||||||
|
<if test="traceCode != null and traceCode != ''">
|
||||||
|
AND a.trace_Code=#{traceCode}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="exceptionInfo != null and exceptionInfo != ''">
|
||||||
|
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
|
||||||
|
<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
|
||||||
|
<if test="dbName == 'oracle'">'%'||#{serverIp}||'%'</if>
|
||||||
|
<if test="dbName == 'mssql'">'%'+#{serverIp}+'%'</if>
|
||||||
|
<if test="dbName == 'mysql'">CONCAT('%', #{serverIp}, '%')</if>
|
||||||
|
</if>
|
||||||
|
<if test="exception != null and exception != ''">
|
||||||
|
AND a.exception_Info!=''
|
||||||
|
</if>
|
||||||
|
ORDER BY a.request_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -49,7 +49,7 @@ public class HiveSqlService {
|
|||||||
}
|
}
|
||||||
sql.setLength(0);
|
sql.setLength(0);
|
||||||
sql.append(" select " + sqlTrim + " from " + tableName + " t where 1=1 ");
|
sql.append(" select " + sqlTrim + " from " + tableName + " t where 1=1 ");
|
||||||
if (bean != null) {
|
if (!StringUtil.isEmpty(bean)) {
|
||||||
Class<?> clazz = bean.getClass();
|
Class<?> clazz = bean.getClass();
|
||||||
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
|
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
|
||||||
// 获取所有的字段包括public,private,protected,private
|
// 获取所有的字段包括public,private,protected,private
|
||||||
@@ -64,7 +64,7 @@ public class HiveSqlService {
|
|||||||
String typeName = f.getType().getName();
|
String typeName = f.getType().getName();
|
||||||
if (f.getType().getName().equals("java.lang.String") && key.startsWith("search")) {
|
if (f.getType().getName().equals("java.lang.String") && key.startsWith("search")) {
|
||||||
Object value = getFieldValue(bean, key);
|
Object value = getFieldValue(bean, key);
|
||||||
if (value != null) {
|
if (!StringUtil.isEmpty(value)) {
|
||||||
setFieldValue(bean, key, value.toString().trim());
|
setFieldValue(bean, key, value.toString().trim());
|
||||||
if (key.endsWith("Time")) {// 日期开始或结束的字段
|
if (key.endsWith("Time")) {// 日期开始或结束的字段
|
||||||
if (col2col.containsKey(key)) {
|
if (col2col.containsKey(key)) {
|
||||||
@@ -159,7 +159,7 @@ public class HiveSqlService {
|
|||||||
String typeName = f.getType().getName();
|
String typeName = f.getType().getName();
|
||||||
if (f.getType().getName().equals("java.lang.String") && key.startsWith("search")) {
|
if (f.getType().getName().equals("java.lang.String") && key.startsWith("search")) {
|
||||||
Object value = getFieldValue(bean, key);
|
Object value = getFieldValue(bean, key);
|
||||||
if (value != null) {
|
if (!StringUtil.isEmpty(value)) {
|
||||||
setFieldValue(bean, key, value.toString().trim());
|
setFieldValue(bean, key, value.toString().trim());
|
||||||
if (key.endsWith("Time")) {// 日期开始或结束的字段
|
if (key.endsWith("Time")) {// 日期开始或结束的字段
|
||||||
if (col2col.containsKey(key)) {
|
if (col2col.containsKey(key)) {
|
||||||
|
|||||||
25
src/main/java/com/nis/web/service/SwaggerLogService.java
Normal file
25
src/main/java/com/nis/web/service/SwaggerLogService.java
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package com.nis.web.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.SwaggerLog;
|
||||||
|
import com.nis.util.DateUtils;
|
||||||
|
import com.nis.web.dao.SwaggerLogDao;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SwaggerLogService extends CrudService<SwaggerLogDao, SwaggerLog> {
|
||||||
|
|
||||||
|
|
||||||
|
public Page<SwaggerLog> findSwaggerLogPage(Page<SwaggerLog> page, SwaggerLog sysLog) {
|
||||||
|
// 设置默认时间范围,默认当前月
|
||||||
|
if (sysLog.getBeginDate() == null) {
|
||||||
|
sysLog.setBeginDate(DateUtils.setDays(DateUtils.parseDate(DateUtils.getDate()), 1));
|
||||||
|
}
|
||||||
|
if (sysLog.getEndDate() == null) {
|
||||||
|
sysLog.setEndDate(DateUtils.addMonths(sysLog.getBeginDate(), 1));
|
||||||
|
}
|
||||||
|
return super.findPage(page, sysLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<!-- <ul class="nav nav-tabs"> -->
|
<!-- <ul class="nav nav-tabs"> -->
|
||||||
<%-- <li class="active"><a href="${ctx}/sys/log/">日志列表</a></li> --%>
|
<%-- <li class="active"><a href="${ctx}/sys/log/">日志列表</a></li> --%>
|
||||||
<!-- </ul> -->
|
<!-- </ul> -->
|
||||||
<form:form id="searchForm" action="${ctx}/sys/log" method="post" class="breadcrumb form-search">
|
<form:form id="searchForm" action="${ctx}/sys/log/list" method="post" class="breadcrumb form-search">
|
||||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
70
src/main/webapp/WEB-INF/views/sys/swaggerLogList.jsp
Normal file
70
src/main/webapp/WEB-INF/views/sys/swaggerLogList.jsp
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>swagger日志管理</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".tooltips").tooltip();
|
||||||
|
});
|
||||||
|
function page(n,s){
|
||||||
|
$("#pageNo").val(n);
|
||||||
|
$("#pageSize").val(s);
|
||||||
|
$("#searchForm").submit();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- <ul class="nav nav-tabs"> -->
|
||||||
|
<%-- <li class="active"><a href="${ctx}/sys/log/">日志列表</a></li> --%>
|
||||||
|
<!-- </ul> -->
|
||||||
|
<form:form id="searchForm" action="${ctx}/sys/log/swaggerLogList" method="post" class="breadcrumb form-search">
|
||||||
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||||
|
<div>
|
||||||
|
<label>traceCode:</label><input id="traceCode" name="traceCode" type="text" maxlength="30" class="input-mini" value="${swaggerLog.traceCode}"/>
|
||||||
|
<label>异常信息:</label><input id="exceptionInfo" name="exceptionInfo" type="text" maxlength="500" class="input-mini" value="${swaggerLog.exceptionInfo}"/>
|
||||||
|
<label>请求ip:</label><input id="requestIp" name="requestIp" type="text" maxlength="50" class="input-mini" value="${swaggerLog.requestIp}"/>
|
||||||
|
<label>服务端ip:</label><input id="serverIp" name="serverIp" type="text" maxlength="50" class="input-mini" value="${swaggerLog.serverIp}"/>
|
||||||
|
</div><div style="margin-top:8px;">
|
||||||
|
<label>请求日期范围: </label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
|
||||||
|
value="<fmt:formatDate value="${swaggerLog.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
|
||||||
|
<label> -- </label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
|
||||||
|
value="<fmt:formatDate value="${swaggerLog.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
|
||||||
|
<label for="exception">
|
||||||
|
|
||||||
|
<input id="exception" name="exception" type="checkbox"${swaggerLog.exception eq '1'?' checked':''} value="1"/>只查询异常信息</label>
|
||||||
|
|
||||||
|
<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
|
||||||
|
</div>
|
||||||
|
</form:form>
|
||||||
|
<sys:message content="${message}"/>
|
||||||
|
<table id="contentTable" class="table table-striped table-bordered table-condensed">
|
||||||
|
<thead><tr><th>请求内容</th><th>traceCode</th><th>请求方式</th><th>请求ip</th><th>服务端ip</th><th>请求时间</th></thead>
|
||||||
|
<tbody><%request.setAttribute("strEnter", "\n");request.setAttribute("strTab", "\t");%>
|
||||||
|
<c:forEach items="${page.list}" var="log">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a data-original-title="${fn:escapeXml(log.requestContent) }" class="tooltips" data-flag="false"
|
||||||
|
data-html="true" data-placement="top"> ${fn:substring(log.requestContent,0,20) }</a>
|
||||||
|
</td>
|
||||||
|
<td>${log.traceCode}</td>
|
||||||
|
<td>${log.opAction}</td>
|
||||||
|
<td><strong>${log.requestIp}</strong></td>
|
||||||
|
<td>${log.serverIp}</td>
|
||||||
|
<td><fmt:formatDate value="${log.requestTime}" type="both"/></td>
|
||||||
|
</tr>
|
||||||
|
<c:if test="${not empty log.exceptionInfo}"><tr>
|
||||||
|
<td colspan="8" style="word-wrap:break-word;word-break:break-all;">
|
||||||
|
<%-- 用户代理: ${log.userAgent}<br/> --%>
|
||||||
|
<%-- 提交参数: ${fns:escapeHtml(log.params)} <br/> --%>
|
||||||
|
异常信息: <br/>
|
||||||
|
${fn:replace(fn:replace(fns:escapeHtml(log.exceptionInfo), strEnter, '<br/>'), strTab, ' ')}</td>
|
||||||
|
</tr></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="pagination">${page}</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -77,6 +77,12 @@
|
|||||||
<listener>
|
<listener>
|
||||||
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
|
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
|
||||||
</listener>
|
</listener>
|
||||||
|
<!-- 让web应用程序启动那个时自动添加属性文件 -->
|
||||||
|
<context-param>
|
||||||
|
<param-name>log4jConfigLocation</param-name>
|
||||||
|
<param-value>classpath:log4j.properties</param-value>
|
||||||
|
</context-param>
|
||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>webAppRootKey</param-name>
|
<param-name>webAppRootKey</param-name>
|
||||||
<param-value>nis.root</param-value>
|
<param-value>nis.root</param-value>
|
||||||
|
|||||||
Reference in New Issue
Block a user