Commit 9f754b2f authored by 井熙铎's avatar 井熙铎

Merge remote-tracking branch 'origin/master'

parents 7704443a 8339f66c
...@@ -30,6 +30,7 @@ import org.aspectj.lang.annotation.Aspect; ...@@ -30,6 +30,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
/** /**
* @author Zheng Jie * @author Zheng Jie
...@@ -83,7 +84,8 @@ public class LogAspect { ...@@ -83,7 +84,8 @@ public class LogAspect {
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get()); Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get());
currentTime.remove(); currentTime.remove();
log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes()); log.setExceptionDetail(Arrays.toString(ThrowableUtil.getStackTrace(e).getBytes()));
// log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes());
HttpServletRequest request = RequestHolder.getHttpServletRequest(); HttpServletRequest request = RequestHolder.getHttpServletRequest();
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log); logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log);
} }
......
...@@ -69,7 +69,7 @@ public class Log implements Serializable { ...@@ -69,7 +69,7 @@ public class Log implements Serializable {
private Long time; private Long time;
/** 异常详细 */ /** 异常详细 */
private byte[] exceptionDetail; private String exceptionDetail;
/** 创建日期 */ /** 创建日期 */
@CreationTimestamp @CreationTimestamp
......
...@@ -136,8 +136,8 @@ public class LogServiceImpl implements LogService { ...@@ -136,8 +136,8 @@ public class LogServiceImpl implements LogService {
public Object findByErrDetail(Long id) { public Object findByErrDetail(Long id) {
Log log = logRepository.findById(id).orElseGet(Log::new); Log log = logRepository.findById(id).orElseGet(Log::new);
ValidationUtil.isNull(log.getId(), "Log", "id", id); ValidationUtil.isNull(log.getId(), "Log", "id", id);
byte[] details = log.getExceptionDetail(); String details = log.getExceptionDetail();
return Dict.create().set("exception", new String(ObjectUtil.isNotNull(details) ? details : "".getBytes())); return Dict.create().set("exception", ObjectUtil.isNotNull(details) ? details : Arrays.toString("".getBytes()));
} }
@Override @Override
...@@ -151,7 +151,7 @@ public class LogServiceImpl implements LogService { ...@@ -151,7 +151,7 @@ public class LogServiceImpl implements LogService {
map.put("描述", log.getDescription()); map.put("描述", log.getDescription());
map.put("浏览器", log.getBrowser()); map.put("浏览器", log.getBrowser());
map.put("请求耗时/毫秒", log.getTime()); map.put("请求耗时/毫秒", log.getTime());
map.put("异常详情", new String(ObjectUtil.isNotNull(log.getExceptionDetail()) ? log.getExceptionDetail() : "".getBytes())); map.put("异常详情", String.valueOf(ObjectUtil.isNotNull(log.getExceptionDetail()) ? log.getExceptionDetail() : Arrays.toString("".getBytes())));
map.put("创建日期", log.getCreateTime()); map.put("创建日期", log.getCreateTime());
list.add(map); list.add(map);
} }
......
...@@ -97,7 +97,7 @@ public class ExecutionJob extends QuartzJobBean { ...@@ -97,7 +97,7 @@ public class ExecutionJob extends QuartzJobBean {
log.setTime(times); log.setTime(times);
// 任务状态 0:成功 1:失败 // 任务状态 0:成功 1:失败
log.setIsSuccess(false); log.setIsSuccess(false);
log.setExceptionDetail(ThrowableUtil.getStackTrace(e)); // log.setExceptionDetail(ThrowableUtil.getStackTrace(e));
// 任务如果失败了则暂停 // 任务如果失败了则暂停
if(quartzJob.getPauseAfterFailure() != null && quartzJob.getPauseAfterFailure()){ if(quartzJob.getPauseAfterFailure() != null && quartzJob.getPauseAfterFailure()){
quartzJob.setIsPause(false); quartzJob.setIsPause(false);
......
...@@ -19,11 +19,11 @@ spring: ...@@ -19,11 +19,11 @@ spring:
ddl-auto: update ddl-auto: update
open-in-view: true open-in-view: true
show-sql: true show-sql: false
properties: properties:
hibernate: hibernate:
dialect: org.hibernate.dialect.Oracle10gDialect dialect: org.hibernate.dialect.Oracle10gDialect
format_sql: true format_sql: false
use_sql_comments: true use_sql_comments: true
...@@ -35,6 +35,16 @@ spring: ...@@ -35,6 +35,16 @@ spring:
password: ${REDIS_PWD:} password: ${REDIS_PWD:}
#连接超时时间 #连接超时时间
timeout: 5000 timeout: 5000
logging:
level:
org.springframework.security:
- debug
- info
org.springframework.web: error
org.hibernate.SQL: debug
org.hibernate.engine.QueryParameters: debug
org.hibernate.engine.query.HQLQueryPlan: debug
org.hibernate.type.descriptor.sql.BasicBinder: trace
task: task:
pool: pool:
......
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