Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EL-ADMIN
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JiangSN
EL-ADMIN
Commits
9f754b2f
Commit
9f754b2f
authored
Oct 12, 2021
by
井熙铎
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
7704443a
8339f66c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
8 deletions
+20
-8
LogAspect.java
...n-logging/src/main/java/me/zhengjie/aspect/LogAspect.java
+3
-1
Log.java
...eladmin-logging/src/main/java/me/zhengjie/domain/Log.java
+1
-1
LogServiceImpl.java
...rc/main/java/me/zhengjie/service/impl/LogServiceImpl.java
+3
-3
ExecutionJob.java
...n/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java
+1
-1
application.yml
.../eladmin-system/src/main/resources/config/application.yml
+12
-2
No files found.
eladmin/eladmin-logging/src/main/java/me/zhengjie/aspect/LogAspect.java
View file @
9f754b2f
...
@@ -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
);
}
}
...
...
eladmin/eladmin-logging/src/main/java/me/zhengjie/domain/Log.java
View file @
9f754b2f
...
@@ -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
...
...
eladmin/eladmin-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java
View file @
9f754b2f
...
@@ -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
);
}
}
...
...
eladmin/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java
View file @
9f754b2f
...
@@ -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
);
...
...
eladmin/eladmin-system/src/main/resources/config/application.yml
View file @
9f754b2f
...
@@ -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
:
tru
e
show-sql
:
fals
e
properties
:
properties
:
hibernate
:
hibernate
:
dialect
:
org.hibernate.dialect.Oracle10gDialect
dialect
:
org.hibernate.dialect.Oracle10gDialect
format_sql
:
tru
e
format_sql
:
fals
e
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment