add:es线上配置
This commit is contained in:
18
lms/nladmin-system/src/main/java/org/nl/config/ESConfig.java
Normal file
18
lms/nladmin-system/src/main/java/org/nl/config/ESConfig.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package org.nl.config;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/13 9:58 上午
|
||||
*/
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@Data
|
||||
public class ESConfig {
|
||||
|
||||
@Value(("${es.index}"))
|
||||
private String index;
|
||||
}
|
||||
@@ -123,11 +123,8 @@ public class LogAspect {
|
||||
StackTraceElement[] stackTrace = ex.getStackTrace();
|
||||
if (stackTrace!=null && stackTrace.length>0){
|
||||
for (StackTraceElement stack : stackTrace) {
|
||||
x++;
|
||||
errorStack.append(stack.toString().replaceAll("<",">")).append("<br/>");
|
||||
if (x>10){
|
||||
break;
|
||||
}
|
||||
x++;errorStack.append(stack.toString().replaceAll("<",">")).append("<br/>");
|
||||
if (x>10){ break; }
|
||||
}
|
||||
}
|
||||
log.error("[-requestError-][请求接口:{}]【异常信息:{}】[请求参数:{}] {}", url,errorMsg,params, errorStack.append("】").toString());
|
||||
@@ -179,7 +176,4 @@ public class LogAspect {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.data.elasticsearch.annotations.Document;
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/8 4:06 下午
|
||||
*/
|
||||
@Document(indexName = "lms_log", type = "lms_log")
|
||||
@Document(indexName = "#{@ESConfig.index}", type = "lms_log")
|
||||
@Data
|
||||
public class LogRepositoryDTO {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user