|
@@ -10,6 +10,7 @@ import com.qmth.boot.core.security.exception.AuthorizationException;
|
|
|
import com.qmth.boot.core.security.model.AccessEntity;
|
|
|
import com.qmth.boot.core.security.service.AuthorizationSupport;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.MDC;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -44,6 +45,9 @@ public class AuthorizationInterceptor extends AbstractInterceptor implements Log
|
|
|
// 默认取签名标识作为接口访问者标识
|
|
|
if (request.getAttribute(ATTRIBUTE_CALLER) == null) {
|
|
|
request.setAttribute(ATTRIBUTE_CALLER, entity.getLogName());
|
|
|
+ MDC.put(MDC_CALLER, entity.getLogName());
|
|
|
+ } else {
|
|
|
+ MDC.put(MDC_CALLER, "-");
|
|
|
}
|
|
|
} catch (AuthorizationException ae) {
|
|
|
log.warn("Authorization faile: path={}, reason={}", request.getServletPath(), ae.getMessage());
|