fix(executor-manager): 日志改为动态配置
This commit is contained in:
@@ -16,9 +16,18 @@ import org.springframework.stereotype.Component;
|
||||
public class ExecutorConfiguration {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ExecutorConfiguration.class);
|
||||
|
||||
private String lokiPushUrl;
|
||||
private String taskJarPath;
|
||||
private String taskResultPath;
|
||||
|
||||
public String getLokiPushUrl() {
|
||||
return lokiPushUrl;
|
||||
}
|
||||
|
||||
public void setLokiPushUrl(String lokiPushUrl) {
|
||||
this.lokiPushUrl = lokiPushUrl;
|
||||
}
|
||||
|
||||
public String getTaskJarPath() {
|
||||
return taskJarPath;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.lanyuanxiaoyao.service.common.Constants;
|
||||
import com.lanyuanxiaoyao.service.executor.Runner;
|
||||
import com.lanyuanxiaoyao.service.executor.core.TaskConstants;
|
||||
import com.lanyuanxiaoyao.service.executor.core.TaskContext;
|
||||
@@ -133,6 +134,7 @@ public class ExecutorTaskService {
|
||||
configuration.setString(YarnConfigOptions.APPLICATION_NAME, StrUtil.format("Service_Task {} #{}", name, taskId));
|
||||
|
||||
setEnvironment(configuration, "task_id", taskId);
|
||||
setEnvironment(configuration, Constants.LOKI_PUSH_URL, executorConfiguration.getLokiPushUrl());
|
||||
|
||||
// 业务jar包
|
||||
String executorJarPath = getLatestExecutorJarPath();
|
||||
|
||||
Reference in New Issue
Block a user