97e0d49c by 李墨

[fix]:修复日志打印

1 parent a0cfa949
......@@ -35,11 +35,11 @@ public class OperateLogAspect implements Ordered {
String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
Object[] args = joinPoint.getArgs();
LOG.info("========================================");
LOG.info(" 操作日志打印:调用 {} {} 方法,请求参数:{}",className,methodName,args);
LOG.info("================== 操作日志打印 start ======================");
LOG.info("\t调用 {} {} 方法,请求参数:{}",className,methodName,args);
Object result = joinPoint.proceed(args);
LOG.info(" 操作日志打印:{} {} 方法,返回结果:{}",result);
LOG.info("========================================");
LOG.info("\t{} {} 方法,返回结果:{}",className,methodName,result);
LOG.info("================== 操作日志打印 end ======================");
return result;
}
......
package com.seektruth.demo.spring.boot.resilience4j.service.impl;
import com.seektruth.demo.spring.boot.resilience4j.controller.BaseController;
import com.seektruth.demo.spring.boot.resilience4j.service.BusinessService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.concurrent.ThreadLocalRandom;
......@@ -12,6 +15,8 @@ import java.util.concurrent.TimeUnit;
@Service
public class BusinessServiceImpl implements BusinessService {
private static final Logger LOG = LoggerFactory.getLogger(BusinessServiceImpl.class);
@Override
public String query() {
randomSleep();
......@@ -25,6 +30,6 @@ public class BusinessServiceImpl implements BusinessService {
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("当前业务处理时长:"+time+"秒");
LOG.info("\t当前业务处理时长:{}秒", time);
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!