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