fix:lucene日志地址
This commit is contained in:
@@ -27,7 +27,8 @@ import org.nl.common.utils.IPUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.RequestHolder;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.lucene.LuceneAppender;
|
||||
import org.nl.wms.system_manage.service.logserver.lucene.BaseCode;
|
||||
import org.nl.wms.system_manage.service.logserver.lucene.LuceneAppender;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -57,8 +58,8 @@ public class LogAspect {
|
||||
*
|
||||
* @param joinPoint join point for advice
|
||||
*/
|
||||
@Around("@annotation(logInfo)")
|
||||
public Object logAround(ProceedingJoinPoint joinPoint,org.nl.common.logging.annotation.Log logInfo) throws Throwable {
|
||||
@Around("@annotation(logAnno)")
|
||||
public Object logAround(ProceedingJoinPoint joinPoint,org.nl.common.logging.annotation.Log logAnno) throws Throwable {
|
||||
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
@@ -69,6 +70,7 @@ public class LogAspect {
|
||||
MDC.put("requestMethod",url);
|
||||
MDC.put("requestIp", requestIp);
|
||||
MDC.put("requestTime", DateUtil.now());
|
||||
LuceneAppender.traceIdTL.set(BaseCode.intToChars(IdUtil.getLongId()));
|
||||
Object result = null;
|
||||
long comming = System.currentTimeMillis();
|
||||
try {
|
||||
@@ -97,6 +99,7 @@ public class LogAspect {
|
||||
}finally {
|
||||
log.info("[--response--][请求接口:{} 执行结束][耗时:{}s]",url,(System.currentTimeMillis() - comming)/1000);
|
||||
MDC.clear();
|
||||
LuceneAppender.traceIdTL.remove();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user