Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
vion-label
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a8872842
authored
Nov 06, 2024
by
姚冰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg] 写日志库注释,无查询的地方
1 parent
d74f5873
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
label-platform/src/main/java/com/viontech/label/platform/interceptor/AuthInterceptor.java
label-platform/src/main/java/com/viontech/label/platform/schedule/AccessLogsAggsTask.java
label-platform/src/main/java/com/viontech/label/platform/service/impl/AccessLogServiceImpl.java
label-platform/src/main/java/com/viontech/label/platform/interceptor/AuthInterceptor.java
View file @
a887284
...
...
@@ -160,7 +160,7 @@ public class AuthInterceptor extends HandlerInterceptorAdapter {
//header user agent暂时不存
//.header(header)
.
build
();
accessLogService
.
saveAccessLogs
(
accessLog
);
//
accessLogService.saveAccessLogs(accessLog);
}
log
.
info
(
"\n用户名:[{}]\n请求信息:[{}]\n请求方式:[{}]\n处理时长:[{}]\n"
,
user
.
getUsername
(),
path
,
request
.
getMethod
(),
System
.
currentTimeMillis
()
-
requestStart
);
...
...
label-platform/src/main/java/com/viontech/label/platform/schedule/AccessLogsAggsTask.java
View file @
a887284
...
...
@@ -15,8 +15,8 @@ import org.springframework.scheduling.annotation.Scheduled;
public
class
AccessLogsAggsTask
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AccessLogsAggsTask
.
class
);
@Autowired
private
ESClient
esClient
;
//
@Autowired
//
private ESClient esClient;
@Autowired
private
IllegalProperties
illegalProperties
;
...
...
label-platform/src/main/java/com/viontech/label/platform/service/impl/AccessLogServiceImpl.java
View file @
a887284
...
...
@@ -16,15 +16,15 @@ import org.springframework.stereotype.Service;
public
class
AccessLogServiceImpl
implements
AccessLogService
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AccessLogServiceImpl
.
class
);
@Autowired
private
ESClient
esClient
;
//
@Autowired
//
private ESClient esClient;
@Override
public
void
saveAccessLogs
(
AccessLog
accessLog
)
{
try
{
esClient
.
saveOrUpdate
(
accessLog
,
true
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"保存访问日志失败:{}"
,
accessLog
);
}
//
try {
//
esClient.saveOrUpdate(accessLog, true);
//
} catch (Exception e) {
//
logger.error("保存访问日志失败:{}", accessLog);
//
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment