Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
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
YZG
yzg-util
Commits
3124779c
Commit
3124779c
authored
Mar 10, 2025
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复异常提醒,从而正确的跟踪异常信息
parent
3b48a1d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
AspectLogStart.java
...-db/src/main/java/com/yanzuoguang/log/AspectLogStart.java
+6
-8
LogInfoVo.java
yzg-util-db/src/main/java/com/yanzuoguang/log/LogInfoVo.java
+13
-0
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/log/AspectLogStart.java
View file @
3124779c
...
...
@@ -20,13 +20,11 @@ public class AspectLogStart {
private
final
CloudConfig
cloudConfig
;
private
final
LogLocal
logLocal
;
private
final
LogString
logString
;
private
final
LogCountTime
logCountTime
;
public
AspectLogStart
(
CloudConfig
cloudConfig
,
LogLocal
logLocal
,
LogString
logString
,
LogCountTime
logCountTime
)
{
public
AspectLogStart
(
CloudConfig
cloudConfig
,
LogLocal
logLocal
,
LogString
logString
)
{
this
.
cloudConfig
=
cloudConfig
;
this
.
logLocal
=
logLocal
;
this
.
logString
=
logString
;
this
.
logCountTime
=
logCountTime
;
}
/**
...
...
@@ -60,20 +58,20 @@ public class AspectLogStart {
body
=
StringHelper
.
EMPTY
;
}
// 声明日志对象
LogInfoVo
log
=
new
LogInfoVo
();
log
.
setLogId
(
StringHelper
.
getNewID
());
log
.
setCreateDate
(
DateHelper
.
getDateTimeString
(
new
Date
()));
// 写入其他对象
log
.
setApplicationName
(
this
.
cloudConfig
.
getApplicationName
());
log
.
setTag
(
tag
);
log
.
setUrl
(
url
);
log
.
setContent
(
body
);
// 生命日志对象爱嗯
log
.
setLogId
(
StringHelper
.
getNewID
());
// 开始记录到日志对象中
log
.
setLogFlag
(
logFlag
&&
this
.
cloudConfig
.
isLogCommon
());
// 开始记录到日志对象中,用于监测系统执行情况,超时时,则直接打印出日志
this
.
logLocal
.
startLog
(
log
);
// 输出日志
boolean
isLog
=
logFlag
&&
this
.
cloudConfig
.
isLogCommon
();
if
(
isLog
)
{
if
(
log
.
isLogFlag
())
{
Log
.
info
(
cls
,
" %s [ %s ] request: %s"
,
tag
,
url
,
body
);
}
return
log
;
...
...
yzg-util-db/src/main/java/com/yanzuoguang/log/LogInfoVo.java
View file @
3124779c
...
...
@@ -55,6 +55,11 @@ public class LogInfoVo extends BaseVo {
*/
@ApiModelProperty
(
value
=
"创建时间"
,
notes
=
"单位(毫秒)"
,
required
=
false
,
example
=
"1987-11-24 23:15:18"
)
private
String
createDate
;
/**
* 是否记录日志
*/
@ApiModelProperty
(
notes
=
"是否记录日志"
)
private
boolean
logFlag
;
public
String
getLogId
()
{
return
logId
;
...
...
@@ -135,4 +140,12 @@ public class LogInfoVo extends BaseVo {
public
void
setCreateDate
(
String
createDate
)
{
this
.
createDate
=
createDate
;
}
public
boolean
isLogFlag
()
{
return
logFlag
;
}
public
void
setLogFlag
(
boolean
logFlag
)
{
this
.
logFlag
=
logFlag
;
}
}
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