Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
4170f907
Commit
4170f907
authored
Nov 12, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-bacground-im' into dev
parents
7852ec69
3c62483a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
AcceptFilter.java
...m/github/wxiaoqi/security/common/filter/AcceptFilter.java
+8
-10
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/filter/AcceptFilter.java
View file @
4170f907
...
@@ -3,26 +3,24 @@ package com.github.wxiaoqi.security.common.filter;
...
@@ -3,26 +3,24 @@ package com.github.wxiaoqi.security.common.filter;
import
ch.qos.logback.classic.spi.ILoggingEvent
;
import
ch.qos.logback.classic.spi.ILoggingEvent
;
import
ch.qos.logback.core.filter.Filter
;
import
ch.qos.logback.core.filter.Filter
;
import
ch.qos.logback.core.spi.FilterReply
;
import
ch.qos.logback.core.spi.FilterReply
;
import
com.github.wxiaoqi.security.common.log.Impl.MailServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
@Slf4j
@Slf4j
public
class
AcceptFilter
extends
Filter
<
ILoggingEvent
>
{
public
class
AcceptFilter
extends
Filter
<
ILoggingEvent
>
{
@Autowired
//
@Autowired
MailServiceImpl
mailService
;
//
MailServiceImpl mailService;
@Override
@Override
public
FilterReply
decide
(
ILoggingEvent
event
)
{
public
FilterReply
decide
(
ILoggingEvent
event
)
{
if
(
event
.
getLoggerName
().
startsWith
(
"com.xxfc.platform"
)
||
event
.
getLoggerName
().
startsWith
(
"com.github.wxiaoqi"
)
||
event
.
getLoggerName
().
contains
(
"Exception"
))
{
if
(
event
.
getLoggerName
().
startsWith
(
"com.xxfc.platform"
)
||
event
.
getLoggerName
().
startsWith
(
"com.github.wxiaoqi"
)
||
event
.
getLoggerName
().
contains
(
"Exception"
))
{
if
(
event
.
getLoggerName
().
contains
(
"Exception"
)
||
event
.
getLoggerName
().
contains
(
"ERROR"
))
{
if
(
event
.
getLoggerName
().
contains
(
"Exception"
)
||
event
.
getLoggerName
().
contains
(
"ERROR"
))
{
//邮件日志
//邮件日志
try
{
//
try {
log
.
info
(
"发送异常邮件,邮件内容:【服务器异常】: {}"
,
event
.
getLoggerName
()
+
":"
+
event
.
getMessage
());
//
log.info("发送异常邮件,邮件内容:【服务器异常】: {}", event.getLoggerName() + ":" +event.getMessage());
mailService
.
sendSimpleMail
(
"jiaoruizhen@126.com"
,
"服务器异常"
,
event
.
getLoggerName
()
+
":"
+
event
.
getMessage
());
//
mailService.sendSimpleMail("jiaoruizhen@126.com", "服务器异常", event.getLoggerName() + ":" +event.getMessage());
}
catch
(
Exception
e
)
{
//
}catch (Exception e) {
log
.
error
(
"发送异常邮件失败,异常信息: {}"
,
e
);
//
log.error("发送异常邮件失败,异常信息: {}", e);
}
//
}
}
}
return
FilterReply
.
ACCEPT
;
return
FilterReply
.
ACCEPT
;
}
else
{
}
else
{
...
...
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