对于支付宝回调参数打印,做简化处理
This commit is contained in:
@ -37,6 +37,21 @@ public class WebLogAspect {
|
|||||||
*/
|
*/
|
||||||
@Before("webLog()")
|
@Before("webLog()")
|
||||||
public void doBefore(JoinPoint joinPoint) {
|
public void doBefore(JoinPoint joinPoint) {
|
||||||
|
// 检查是否是支付宝回调控制器
|
||||||
|
String className = joinPoint.getTarget().getClass().getSimpleName();
|
||||||
|
if ("AliPayNotifyController".equals(className)) {
|
||||||
|
// 对于支付宝回调,简化日志处理
|
||||||
|
log.info("========================= Start =========================");
|
||||||
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
if (attributes != null) {
|
||||||
|
HttpServletRequest request = attributes.getRequest();
|
||||||
|
log.info("URL:{}", request.getRequestURL().toString());
|
||||||
|
}
|
||||||
|
String requestId = UUID.randomUUID().toString();
|
||||||
|
// 使用 requestId 的一部分作为日志标识
|
||||||
|
MDC.put("requestId", requestId.substring(Math.max(0, requestId.length() - 12)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
HttpServletRequest request = null;
|
HttpServletRequest request = null;
|
||||||
String requestId = null;
|
String requestId = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user