Merge pull request #8689 from dataease/pr@dev@perf_shiro_log

perf: 尝试减少shiro日志
This commit is contained in:
fit2cloud-chenyw 2024-03-25 19:43:16 +08:00 committed by GitHub
commit 0e359e54c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -92,8 +92,7 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
if (isLoginAttempt(request, response) || ApiKeyHandler.isApiKeyCall(hRequest)) {
try {
boolean loginSuccess = executeLogin(request, response);
return loginSuccess;
return executeLogin(request, response);
} catch (Exception e) {
LogUtil.error(e);
if (e instanceof AuthenticationException && StringUtils.equals(e.getMessage(), expireMessage)) {

View File

@ -2,7 +2,9 @@ package io.dataease.controller.handler;
import io.dataease.controller.ResultHolder;
import io.dataease.i18n.Translator;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorController;
@ -49,7 +51,7 @@ public class GlobalExceptionHandler implements ErrorController {
response.setStatus(code);
String errorMessage = StringUtils.EMPTY;
if (t != null) {
if (Logger.isDebugEnabled()) {
if (Logger.isDebugEnabled() && (ObjectUtils.isEmpty(t.getCause()) || !(t.getCause() instanceof AuthenticationException))) {
Logger.error("Fail to proceed " + errorAttributeMap.get("path"), t);
}
errorMessage = t.getMessage();

View File

@ -81,6 +81,7 @@ server.servlet.context-parameters.configurationStrategy=SYSTEM_PROPERTIES
server.servlet.session.cookie.http-only=true
server.servlet.session.tracking-modes=cookie
spring.jackson.parser.allow-numeric-leading-zeros=true
logging.level.org.apache.shiro=OFF