feat(日志): 访问日志增加过滤支持
This commit is contained in:
parent
4a421c980f
commit
8957c8b386
|
|
@ -2,6 +2,7 @@ package org.jetlinks.community.logging.access;
|
|||
|
||||
import org.hswebframework.web.logging.events.AccessLoggerAfterEvent;
|
||||
import org.jetlinks.community.logging.configuration.LoggingProperties;
|
||||
import org.jetlinks.core.utils.TopicUtils;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -20,6 +21,11 @@ public class AccessLoggingTranslator {
|
|||
|
||||
@EventListener
|
||||
public void translate(AccessLoggerAfterEvent event) {
|
||||
for (String pathExclude : properties.getAccess().getPathExcludes()) {
|
||||
if (TopicUtils.match(pathExclude, event.getLogger().getUrl())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
eventPublisher.publishEvent(SerializableAccessLog.of(event.getLogger()));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue