Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
log-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
log-platform
Commits
aefa5c7d
Commit
aefa5c7d
authored
Aug 24, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常日志添加
parent
c01b2f57
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
1455 additions
and
389 deletions
+1455
-389
db/menu.sql
db/menu.sql
+14
-0
db/module.sql
db/module.sql
+17
-8
log-manager-ui/admin/package-lock.json
log-manager-ui/admin/package-lock.json
+2
-1
log-manager-ui/admin/package.json
log-manager-ui/admin/package.json
+2
-1
log-manager-ui/admin/src/views/error/log/drawershow.vue
log-manager-ui/admin/src/views/error/log/drawershow.vue
+31
-16
log-manager-ui/admin/src/views/error/log/list.vue
log-manager-ui/admin/src/views/error/log/list.vue
+20
-24
log-manager-ui/admin/src/views/error/log/view.vue
log-manager-ui/admin/src/views/error/log/view.vue
+35
-11
log-manager-ui/admin/yarn.lock
log-manager-ui/admin/yarn.lock
+5
-0
log-manager/src/main/java/com/mortals/xhx/base/framework/filter/RequestFilter.java
.../com/mortals/xhx/base/framework/filter/RequestFilter.java
+1
-1
log-manager/src/main/java/com/mortals/xhx/common/code/LevelEnum.java
.../src/main/java/com/mortals/xhx/common/code/LevelEnum.java
+68
-0
log-manager/src/main/java/com/mortals/xhx/common/code/PlatformEnum.java
...c/main/java/com/mortals/xhx/common/code/PlatformEnum.java
+71
-0
log-manager/src/main/java/com/mortals/xhx/module/access/service/impl/AccessLogServiceImpl.java
.../xhx/module/access/service/impl/AccessLogServiceImpl.java
+0
-2
log-manager/src/main/java/com/mortals/xhx/module/error/dao/ErrorLogDao.java
...in/java/com/mortals/xhx/module/error/dao/ErrorLogDao.java
+2
-1
log-manager/src/main/java/com/mortals/xhx/module/error/dao/ibatis/ErrorLogDaoImpl.java
.../mortals/xhx/module/error/dao/ibatis/ErrorLogDaoImpl.java
+1
-3
log-manager/src/main/java/com/mortals/xhx/module/error/model/ErrorLogEntity.java
...va/com/mortals/xhx/module/error/model/ErrorLogEntity.java
+229
-61
log-manager/src/main/java/com/mortals/xhx/module/error/model/ErrorLogQuery.java
...ava/com/mortals/xhx/module/error/model/ErrorLogQuery.java
+500
-120
log-manager/src/main/java/com/mortals/xhx/module/error/model/vo/ErrorLogVo.java
...ava/com/mortals/xhx/module/error/model/vo/ErrorLogVo.java
+1
-1
log-manager/src/main/java/com/mortals/xhx/module/error/service/ErrorLogService.java
...com/mortals/xhx/module/error/service/ErrorLogService.java
+1
-1
log-manager/src/main/java/com/mortals/xhx/module/error/service/impl/ErrorLogServiceImpl.java
...ls/xhx/module/error/service/impl/ErrorLogServiceImpl.java
+24
-8
log-manager/src/main/java/com/mortals/xhx/module/error/web/ErrorLogController.java
.../com/mortals/xhx/module/error/web/ErrorLogController.java
+3
-3
log-manager/src/main/resources/sqlmap/module/error/ErrorLogMapper.xml
...src/main/resources/sqlmap/module/error/ErrorLogMapper.xml
+402
-108
log-manager/src/test/java/com/mortals/httpclient/error/ErrorLogController.http
...java/com/mortals/httpclient/error/ErrorLogController.http
+20
-13
log-manager/src/test/java/com/mortals/httpclient/http-client.env.json
...src/test/java/com/mortals/httpclient/http-client.env.json
+6
-6
No files found.
db/menu.sql
View file @
aefa5c7d
...
...
@@ -40,6 +40,20 @@ INSERT INTO `mortals_xhx_resource` VALUES (null, '异常日志-菜单管理-维
-- ----------------------------
-- 异常日志参数 SQL
-- ----------------------------
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'java'
,
'java'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'php'
,
'php'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'c#'
,
'c#'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'android'
,
'android'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'vue'
,
'vue'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'webos'
,
'webos'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'ios'
,
'ios'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'当前客户端使用平台'
,
'ErrorLog'
,
'platform'
,
'python'
,
'python'
,
1
,
4
,
0
,
'platform'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'等级'
,
'ErrorLog'
,
'level'
,
'FATAL'
,
'FATAL'
,
1
,
4
,
0
,
'level'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'等级'
,
'ErrorLog'
,
'level'
,
'ERROR'
,
'ERROR'
,
1
,
4
,
0
,
'level'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'等级'
,
'ErrorLog'
,
'level'
,
'WARNING'
,
'WARNING'
,
1
,
4
,
0
,
'level'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'等级'
,
'ErrorLog'
,
'level'
,
'INFO'
,
'INFO'
,
1
,
4
,
0
,
'level'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'等级'
,
'ErrorLog'
,
'level'
,
'DEBUG'
,
'DEBUG'
,
1
,
4
,
0
,
'level'
,
NULL
,
NULL
,
NULL
);
-- ----------------------------
-- 平台用户操作日志业务菜单 SQL
-- ----------------------------
...
...
db/module.sql
View file @
aefa5c7d
...
...
@@ -57,19 +57,28 @@ DROP TABLE IF EXISTS `mortals_xhx_error_log`;
CREATE
TABLE
mortals_xhx_error_log
(
`id`
bigint
(
20
)
COMMENT
'主键ID'
,
`traceID`
varchar
(
64
)
COMMENT
'追踪Id'
,
`serverType`
varchar
(
64
)
COMMENT
'服务类型,webOS,android,IOS,服务后端'
,
`appName`
varchar
(
64
)
COMMENT
'应用名称'
,
`hostName`
varchar
(
64
)
COMMENT
'实例IP'
,
`logLevel`
varchar
(
64
)
COMMENT
'日志等级'
,
`appName`
varchar
(
64
)
COMMENT
'应用名称,宿主客户端运行唯一标识。'
,
`hostName`
varchar
(
64
)
COMMENT
'主机名'
,
`message`
varchar
(
256
)
COMMENT
'消息标识,如用户登录异常。'
,
`platform`
varchar
(
64
)
COMMENT
'当前客户端使用平台(java,php,c#,android,vue,webos,ios,python)'
,
`culprit`
varchar
(
512
)
COMMENT
'主要导致异常函数或方法调用名称'
,
`tags`
varchar
(
512
)
COMMENT
'异常事件标记,多个逗号分隔。用以归集异常事件种类。'
,
`level`
varchar
(
64
)
COMMENT
'等级(FATAL,ERROR,WARNING,INFO,DEBUG)'
,
`environment`
varchar
(
1024
)
COMMENT
'客户端运行环境变量信息'
,
`releaseVersion`
varchar
(
64
)
COMMENT
'客户端运行版本信息'
,
`fingerprint`
varchar
(
64
)
COMMENT
'指纹标识,对于相同异常事件归集数量使用。'
,
`threadNo`
varchar
(
64
)
COMMENT
'线程号'
,
`error`
text
COMMENT
'异常堆栈信息'
,
`response`
text
COMMENT
'响应结果'
,
`logTime`
datetime
COMMENT
'日志产生时间'
,
`createUserId`
bigint
(
20
)
NOT
NULL
COMMENT
'创建用户'
,
`checkNum`
int
(
4
)
COMMENT
'针对同一个异常事件,数量加1'
,
`errorStack`
text
COMMENT
'异常堆栈信息'
,
`context`
text
COMMENT
'上下文信息,如js中发送异常事件,定位源码中信息。'
,
`extra`
varchar
(
2048
)
COMMENT
'扩展信息'
,
`logTime`
datetime
COMMENT
'日志时间'
,
`createUserId`
bigint
(
20
)
COMMENT
'创建用户'
,
`createTime`
datetime
NOT
NULL
COMMENT
'创建时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'异常日志'
;
-- ----------------------------
-- 平台用户操作日志业务表
-- ----------------------------
...
...
log-manager-ui/admin/package-lock.json
View file @
aefa5c7d
...
...
@@ -35,7 +35,8 @@
"vue-cropper": "0.5.5",
"vue-router": "3.4.9",
"vue2-org-tree": "^1.3.5",
"vuex": "3.6.0"
"vuex": "3.6.0",
"highlight.js": "11.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
log-manager-ui/admin/package.json
View file @
aefa5c7d
...
...
@@ -36,7 +36,8 @@
"vue-cropper"
:
"0.5.5"
,
"vue-router"
:
"3.4.9"
,
"vue2-org-tree"
:
"^1.3.5"
,
"vuex"
:
"3.6.0"
"vuex"
:
"3.6.0"
,
"highlight.js"
:
"11.6.0"
},
"devDependencies"
:
{
"@vue/cli-plugin-babel"
:
"4.4.6"
,
...
...
log-manager-ui/admin/src/views/error/log/drawershow.vue
View file @
aefa5c7d
...
...
@@ -4,22 +4,29 @@
:title=
"title"
:visible.sync=
"open"
:direction=
"direction"
size=
"
5
0%"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"1
2
0px"
>
size=
"
7
0%"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"1
4
0px"
>
<el-row>
<Field
label=
"追踪Id"
prop=
"traceID"
v-model=
"form.traceID"
placeholder=
"请输入追踪Id"
/>
<Field
label=
"服务类型,webOS,android,IOS,服务后端"
prop=
"serverType"
v-model=
"form.serverType"
placeholder=
"请输入服务类型,webOS,android,IOS,服务后端"
/>
<Field
label=
"应用名称"
prop=
"appName"
v-model=
"form.appName"
placeholder=
"请输入应用名称"
/>
<Field
label=
"实例IP"
prop=
"hostName"
v-model=
"form.hostName"
placeholder=
"请输入实例IP"
/>
<Field
label=
"日志等级"
prop=
"logLevel"
v-model=
"form.logLevel"
placeholder=
"请输入日志等级"
/>
<Field
label=
"追踪Id"
prop=
"traceID"
v-model=
"form.traceID"
placeholder=
"请输入追踪Id"
/>
<Field
label=
"应用名称"
prop=
"appName"
v-model=
"form.appName"
placeholder=
"请输入应用名称,宿主客户端运行唯一标识。"
/>
<Field
label=
"主机名"
prop=
"hostName"
v-model=
"form.hostName"
placeholder=
"请输入主机名"
/>
<Field
label=
"消息标识"
prop=
"message"
v-model=
"form.message"
placeholder=
"请输入消息标识,如用户登录异常。"
/>
<Field
label=
"客户端使用平台"
prop=
"platform"
v-model=
"form.platform"
type=
"select"
:enumData=
"dict.platform"
placeholder=
"请选择当前客户端使用平台"
/>
<Field
label=
"异常函数名"
prop=
"culprit"
v-model=
"form.culprit"
placeholder=
"请输入主要导致异常函数或方法调用名称"
/>
<Field
label=
"异常事件标记。"
prop=
"tags"
v-model=
"form.tags"
placeholder=
"请输入异常事件标记,多个逗号分隔。用以归集异常事件种类。"
/>
<Field
label=
"告警等级"
prop=
"level"
v-model=
"form.level"
type=
"select"
:enumData=
"dict.level"
placeholder=
"请选择等级"
/>
<Field
label=
"环境变量信息"
prop=
"environment"
v-model=
"form.environment"
placeholder=
"请输入客户端运行环境变量信息"
/>
<Field
label=
"版本信息"
prop=
"releaseVersion"
v-model=
"form.releaseVersion"
placeholder=
"请输入客户端运行版本信息"
/>
<Field
label=
"指纹标识"
prop=
"fingerprint"
v-model=
"form.fingerprint"
placeholder=
"请输入指纹标识,对于相同异常事件归集数量使用。"
/>
<Field
label=
"线程号"
prop=
"threadNo"
v-model=
"form.threadNo"
placeholder=
"请输入线程号"
/>
<Field
label=
"异常堆栈信息"
prop=
"error"
v-model=
"form.error"
type=
"textarea"
placeholder=
"请输入异常堆栈信息"
/>
<Field
label=
"响应结果"
prop=
"response"
v-model=
"form.response"
type=
"textarea"
placeholder=
"请输入响应结果"
/>
<Field
label=
"日志产生时间"
prop=
"logTime"
v-model=
"form.logTime"
type=
"date"
/>
<Field
label=
"异常事件数量"
prop=
"checkNum"
v-model=
"form.checkNum"
placeholder=
"请输入针对同一个异常事件,数量加1"
/>
<Field
label=
"日志时间"
prop=
"logTime"
v-model=
"form.logTime"
type=
"date"
/>
<Field
label=
"异常堆栈信息"
:span=
"24"
prop=
"errorStack"
v-model=
"form.errorStack"
rows=
"6"
type=
"textarea"
placeholder=
"请输入异常堆栈信息"
/>
<Field
label=
"上下文信息"
:span=
"24"
prop=
"context"
v-model=
"form.context"
type=
"textarea"
placeholder=
"请输入上下文信息,如js中发送异常事件,定位源码中信息。"
/>
<Field
label=
"扩展信息"
:span=
"24"
prop=
"extra"
v-model=
"form.extra"
type=
"textarea"
placeholder=
"请输入扩展信息"
/>
</el-row>
<form-buttons
@
submit=
'submitForm'
noCancelBtn
/>
</el-form>
</el-drawer>
...
...
@@ -104,13 +111,21 @@
reset
()
{
this
.
form
=
{
traceID
:
""
,
serverType
:
""
,
appName
:
""
,
hostName
:
""
,
logLevel
:
""
,
message
:
""
,
platform
:
"
java
"
,
culprit
:
""
,
tags
:
""
,
level
:
""
,
environment
:
""
,
releaseVersion
:
""
,
fingerprint
:
""
,
threadNo
:
""
,
error
:
""
,
response
:
""
,
checkNum
:
null
,
errorStack
:
""
,
context
:
""
,
extra
:
""
,
logTime
:
null
,
};
this
.
resetForm
(
"
form
"
);
...
...
log-manager-ui/admin/src/views/error/log/list.vue
View file @
aefa5c7d
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
notAdd
notDel
:config=
"tableConfig"
>
<LayoutTable
notAdd
notDel
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
...
...
@@ -43,47 +43,43 @@
{
name
:
"
traceID
"
,
type
:
"
text
"
,
label
:
"
TraceID
"
,
fuzzy
:
true
},
{
name
:
"
serverType
"
,
type
:
"
text
"
,
label
:
"
服务类型,webOS,android,IOS,服务后端
"
,
label
:
"
追踪Id
"
,
fuzzy
:
true
},
{
name
:
"
appName
"
,
type
:
"
text
"
,
label
:
"
应用名称
"
,
fuzzy
:
true
},
{
name
:
"
logTime
"
,
type
:
"
date
"
,
label
:
"
日志产生时间
"
,
label
:
"
应用名称,宿主客户端运行唯一标识。
"
,
fuzzy
:
true
},
],
columns
:
[
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
,
align
:
"
center
"
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
label
:
"
TraceID
"
,
prop
:
"
traceID
"
},
{
label
:
"
服务类型
"
,
prop
:
"
serverType
"
},
{
label
:
"
追踪Id
"
,
prop
:
"
traceID
"
},
{
label
:
"
应用名称
"
,
prop
:
"
appName
"
},
{
label
:
"
线程号
"
,
prop
:
"
threadNo
"
},
{
label
:
"
主机名
"
,
prop
:
"
hostName
"
},
{
label
:
"
消息标识
"
,
prop
:
"
message
"
},
{
label
:
"
当前客户端使用平台
"
,
prop
:
"
platform
"
,
formatter
:
this
.
formatter
},
{
label
:
"
异常事件标记
"
,
prop
:
"
tags
"
},
{
label
:
"
警告等级
"
,
prop
:
"
level
"
,
formatter
:
this
.
formatter
},
{
label
:
"
异常事件数量
"
,
prop
:
"
checkNum
"
},
{
label
:
"
日志
产生
时间
"
,
prop
:
"
logTime
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
日志时间
"
,
prop
:
"
logTime
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
操作
"
,
width
:
24
0
,
width
:
12
0
,
formatter
:
row
=>
{
return
(
<
table
-
buttons
noAdd
no
Del
noEdit
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
table
-
buttons
noAdd
no
Edit
noDel
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
}
}
...
...
log-manager-ui/admin/src/views/error/log/view.vue
View file @
aefa5c7d
...
...
@@ -11,28 +11,52 @@
<el-descriptions-item
label=
"追踪Id"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.traceID}}
</el-descriptions-item>
<el-descriptions-item
label=
"服务类型,webOS,android,IOS,服务后端"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.serverType}}
</el-descriptions-item>
<el-descriptions-item
label=
"应用名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
<el-descriptions-item
label=
"应用名称,宿主客户端运行唯一标识。"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.appName}}
</el-descriptions-item>
<el-descriptions-item
label=
"
实例IP
"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
<el-descriptions-item
label=
"
主机名
"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.hostName}}
</el-descriptions-item>
<el-descriptions-item
label=
"日志等级"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.logLevel}}
<el-descriptions-item
label=
"消息标识,如用户登录异常。"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.message}}
</el-descriptions-item>
<el-descriptions-item
label=
"当前客户端使用平台"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatters("platform", form.platform) }}
</el-descriptions-item>
<el-descriptions-item
label=
"主要导致异常函数或方法调用名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.culprit}}
</el-descriptions-item>
<el-descriptions-item
label=
"异常事件标记,多个逗号分隔。用以归集异常事件种类。"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.tags}}
</el-descriptions-item>
<el-descriptions-item
label=
"等级"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatters("level", form.level) }}
</el-descriptions-item>
<el-descriptions-item
label=
"客户端运行环境变量信息"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.environment}}
</el-descriptions-item>
<el-descriptions-item
label=
"客户端运行版本信息"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.releaseVersion}}
</el-descriptions-item>
<el-descriptions-item
label=
"指纹标识,对于相同异常事件归集数量使用。"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.fingerprint}}
</el-descriptions-item>
<el-descriptions-item
label=
"线程号"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.threadNo}}
</el-descriptions-item>
<el-descriptions-item
label=
"针对同一个异常事件,数量加1"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.checkNum}}
</el-descriptions-item>
<el-descriptions-item
label=
"异常堆栈信息"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.error}}
{{form.errorStack}}
</el-descriptions-item>
<el-descriptions-item
label=
"上下文信息,如js中发送异常事件,定位源码中信息。"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.context}}
</el-descriptions-item>
<el-descriptions-item
label=
"
响应结果
"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.
response
}}
<el-descriptions-item
label=
"
扩展信息
"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.
extra
}}
</el-descriptions-item>
<el-descriptions-item
label=
"日志
产生
时间"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
<el-descriptions-item
label=
"日志时间"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatterDate(form.logTime)}}
</el-descriptions-item>
</el-descriptions>
...
...
log-manager-ui/admin/yarn.lock
View file @
aefa5c7d
...
...
@@ -4959,6 +4959,11 @@ hex-color-regex@^1.1.0:
resolved "https://registry.nlark.com/hex-color-regex/download/hex-color-regex-1.1.0.tgz"
integrity sha1-TAb8y0YC/iYCs8k9+C1+fb8aio4=
highlight.js@11.6.0:
version "11.6.0"
resolved "https://registry.npmmirror.com/highlight.js/-/highlight.js-11.6.0.tgz#a50e9da05763f1bb0c1322c8f4f755242cff3f5a"
integrity sha512-ig1eqDzJaB0pqEvlPVIpSSyMaO92bH1N2rJpLMN/nX396wTpDA4Eq0uK+7I/2XG17pFaaKE0kjV/XPeGt7Evjw==
highlight.js@^10.7.1:
version "10.7.3"
resolved "https://registry.nlark.com/highlight.js/download/highlight.js-10.7.3.tgz"
...
...
log-manager/src/main/java/com/mortals/xhx/base/framework/filter/RequestFilter.java
View file @
aefa5c7d
...
...
@@ -23,7 +23,7 @@ import java.io.IOException;
* @author: zxfei
* @date: 2022/4/20 14:52
*/
@Component
//
@Component
@Slf4j
public
class
RequestFilter
extends
OncePerRequestFilter
implements
Filter
{
...
...
log-manager/src/main/java/com/mortals/xhx/common/code/LevelEnum.java
0 → 100644
View file @
aefa5c7d
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 等级(FATAL,ERROR,WARNING,INFO,DEBUG)枚举类
*
* @author zxfei
*/
public
enum
LevelEnum
{
FATAL
(
"FATAL"
,
"FATAL"
),
ERROR
(
"ERROR"
,
"ERROR"
),
WARNING
(
"WARNING"
,
"WARNING"
),
INFO
(
"INFO"
,
"INFO"
),
DEBUG
(
"DEBUG"
,
"DEBUG"
);
private
String
value
;
private
String
desc
;
LevelEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
LevelEnum
getByValue
(
String
value
)
{
for
(
LevelEnum
levelEnum
:
LevelEnum
.
values
())
{
if
(
levelEnum
.
getValue
()
==
value
)
{
return
levelEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
LevelEnum
item
:
LevelEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
log-manager/src/main/java/com/mortals/xhx/common/code/PlatformEnum.java
0 → 100644
View file @
aefa5c7d
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 当前客户端使用平台(java,php,c#,android,vue,webos,ios,python)枚举类
*
* @author zxfei
*/
public
enum
PlatformEnum
{
java
(
"java"
,
"java"
),
php
(
"php"
,
"php"
),
c
(
"c#"
,
"c#"
),
android
(
"android"
,
"android"
),
vue
(
"vue"
,
"vue"
),
webos
(
"webos"
,
"webos"
),
ios
(
"ios"
,
"ios"
),
python
(
"python"
,
"python"
);
private
String
value
;
private
String
desc
;
PlatformEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
PlatformEnum
getByValue
(
String
value
)
{
for
(
PlatformEnum
platformEnum
:
PlatformEnum
.
values
())
{
if
(
platformEnum
.
getValue
()
==
value
)
{
return
platformEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
PlatformEnum
item
:
PlatformEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
log-manager/src/main/java/com/mortals/xhx/module/access/service/impl/AccessLogServiceImpl.java
View file @
aefa5c7d
...
...
@@ -29,8 +29,6 @@ public class AccessLogServiceImpl extends AbstractCRUDServiceImpl<AccessLogDao,
accessLogEntity
.
setCreateTime
(
new
Date
(
generateDateTime
));
return
this
.
getDao
().
get
(
key
,
accessLogEntity
);
//return super.get(key, context);
}
public
static
void
main
(
String
[]
args
)
{
...
...
log-manager/src/main/java/com/mortals/xhx/module/error/dao/ErrorLogDao.java
View file @
aefa5c7d
...
...
@@ -8,8 +8,9 @@ import java.util.List;
* 异常日志 DAO接口
*
* @author zxfei
* @date 2022-08-
17
* @date 2022-08-
24
*/
public
interface
ErrorLogDao
extends
ICRUDSubmeterDao
<
ErrorLogEntity
,
Long
>{
...
...
log-manager/src/main/java/com/mortals/xhx/module/error/dao/ibatis/ErrorLogDaoImpl.java
View file @
aefa5c7d
...
...
@@ -17,7 +17,7 @@ import java.util.List;
* 异常日志DaoImpl DAO接口
*
* @author zxfei
* @date 2022-08-
17
* @date 2022-08-
24
*/
@Repository
(
"errorLogDao"
)
public
class
ErrorLogDaoImpl
extends
SubmeterDaoImpl
<
ErrorLogEntity
,
Long
>
implements
ErrorLogDao
{
...
...
@@ -48,6 +48,4 @@ public class ErrorLogDaoImpl extends SubmeterDaoImpl<ErrorLogEntity,Long> implem
}
log-manager/src/main/java/com/mortals/xhx/module/error/model/ErrorLogEntity.java
View file @
aefa5c7d
This diff is collapsed.
Click to expand it.
log-manager/src/main/java/com/mortals/xhx/module/error/model/ErrorLogQuery.java
View file @
aefa5c7d
This diff is collapsed.
Click to expand it.
log-manager/src/main/java/com/mortals/xhx/module/error/model/vo/ErrorLogVo.java
View file @
aefa5c7d
...
...
@@ -7,7 +7,7 @@ import java.util.List;
* 异常日志视图对象
*
* @author zxfei
* @date 2022-08-
17
* @date 2022-08-
24
*/
public
class
ErrorLogVo
extends
BaseEntityLong
{
...
...
log-manager/src/main/java/com/mortals/xhx/module/error/service/ErrorLogService.java
View file @
aefa5c7d
...
...
@@ -7,7 +7,7 @@ import com.mortals.xhx.module.error.model.ErrorLogEntity;
* 异常日志 service接口
*
* @author zxfei
* @date 2022-08-
17
* @date 2022-08-
24
*/
public
interface
ErrorLogService
extends
ICRUDService
<
ErrorLogEntity
,
Long
>{
...
...
log-manager/src/main/java/com/mortals/xhx/module/error/service/impl/ErrorLogServiceImpl.java
View file @
aefa5c7d
package
com.mortals.xhx.module.error.service.impl
;
import
cn.hutool.core.lang.Snowflake
;
import
cn.hutool.core.util.IdUtil
;
import
com.mortals.xhx.module.biz.model.BizLogEntity
;
import
com.mortals.xhx.module.access.model.AccessLogEntity
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -9,18 +9,34 @@ import com.mortals.framework.model.Context;
import
com.mortals.xhx.module.error.dao.ErrorLogDao
;
import
com.mortals.xhx.module.error.model.ErrorLogEntity
;
import
com.mortals.xhx.module.error.service.ErrorLogService
;
import
cn.hutool.core.util.IdUtil
;
import
java.util.Date
;
import
java.util.List
;
/**
* ErrorLogService
* 异常日志 service实现
*
* @author zxfei
* @date 2022-08-17
*/
* ErrorLogService
* 异常日志 service实现
*
* @author zxfei
* @date 2022-08-24
*/
@Service
(
"errorLogService"
)
public
class
ErrorLogServiceImpl
extends
AbstractCRUDServiceImpl
<
ErrorLogDao
,
ErrorLogEntity
,
Long
>
implements
ErrorLogService
{
@Override
protected
void
saveBefore
(
ErrorLogEntity
entity
,
Context
context
)
throws
AppException
{
//非系统自增,需这里设置主键
entity
.
setId
(
IdUtil
.
getSnowflake
(
0
,
1
).
nextId
());
super
.
saveBefore
(
entity
,
context
);
}
@Override
public
int
save
(
List
<
ErrorLogEntity
>
list
,
Context
context
)
throws
AppException
{
list
.
forEach
(
item
->{
item
.
setId
(
IdUtil
.
getSnowflake
(
0
,
1
).
nextId
());
});
return
super
.
save
(
list
,
context
);
}
@Override
public
ErrorLogEntity
get
(
Long
key
,
Context
context
)
throws
AppException
{
...
...
log-manager/src/main/java/com/mortals/xhx/module/error/web/ErrorLogController.java
View file @
aefa5c7d
...
...
@@ -27,7 +27,7 @@ import static com.mortals.framework.ap.SysConstains.*;
* 异常日志
*
* @author zxfei
* @date 2022-08-
17
* @date 2022-08-
24
*/
@RestController
@RequestMapping
(
"error/log"
)
...
...
@@ -42,16 +42,16 @@ public class ErrorLogController extends BaseCRUDJsonBodyMappingController<ErrorL
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"platform"
,
paramService
.
getParamBySecondOrganize
(
"ErrorLog"
,
"platform"
));
this
.
addDict
(
model
,
"level"
,
paramService
.
getParamBySecondOrganize
(
"ErrorLog"
,
"level"
));
super
.
init
(
model
,
context
);
}
@Override
protected
void
doListBefore
(
ErrorLogEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
List
<
OrderCol
>
orderColList
=
new
ArrayList
<>();
orderColList
.
add
(
new
OrderCol
(
"createTime"
,
OrderCol
.
DESCENDING
));
query
.
setOrderColList
(
orderColList
);
super
.
doListBefore
(
query
,
model
,
context
);
}
}
\ No newline at end of file
log-manager/src/main/resources/sqlmap/module/error/ErrorLogMapper.xml
View file @
aefa5c7d
This diff is collapsed.
Click to expand it.
log-manager/src/test/java/com/mortals/httpclient/error/ErrorLogController.http
View file @
aefa5c7d
...
...
@@ -19,10 +19,9 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"traceID":"arvhdl",
"serverType":"nqq0bh",
"appName":"8i6fqg",
"logTime":"1660665600000",
"traceID":"p90qpk",
"appName":"dp7dhc",
"message":"073hnq",
"page":1,
"size":10
}
...
...
@@ -34,15 +33,23 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"traceID":"8ryjdp",
"serverType":"mdgdb8",
"appName":"6fobjf",
"hostName":"mpwzb3",
"logLevel":"of3igm",
"threadNo":"eqdsam",
"error":"asd235",
"response":"2djxe2",
"logTime":"1660665600000",
"traceID":"mbto1z",
"appName":"6lcsoy",
"hostName":"ul06eq",
"message":"8kau4i",
"platform":"java",
"culprit":"8r6wce",
"tags":"sw7jp2",
"level":"INFO",
"environment":"ayr3ua",
"releaseVersion":"chxwkw",
"fingerprint":"2txnit",
"threadNo":"2z9vq4",
"checkNum":1,
"errorStack":"z3yxnh",
"context":"az7aus",
"extra":"9c0pnj",
"logTime":"1661270400000"
}
> {%
...
...
log-manager/src/test/java/com/mortals/httpclient/http-client.env.json
View file @
aefa5c7d
{
"local"
:
{
"baseUrl"
:
"http://127.0.0.1:1822
2/m
"
,
"baseLogin"
:
"http://127.0.0.1:18222/
m
"
"baseUrl"
:
"http://127.0.0.1:1822
5/logservice
"
,
"baseLogin"
:
"http://127.0.0.1:18222/
logservice
"
},
"dev"
:
{
"baseUrl"
:
"http://192.168.0.217:18222/
m
"
,
"baseLogin"
:
"http://192.168.0.98:11078/
bas
e"
"baseUrl"
:
"http://192.168.0.217:18222/
logservice
"
,
"baseLogin"
:
"http://192.168.0.98:11078/
logservic
e"
},
"test"
:
{
"baseUrl"
:
"http://192.168.0.98:110
91/m
"
,
"baseLogin"
:
"http://192.168.0.98:11078/
base
"
"baseUrl"
:
"http://192.168.0.98:110
78/logservice
"
,
"baseLogin"
:
"http://192.168.0.98:11078/
zwfw
"
},
"portal"
:
{
"baseUrl"
:
"http://192.168.0.98:11072/zwfw"
,
...
...
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