diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 02cf30b6..6957a44a 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -2845,8 +2845,9 @@ alter table xxl_job_log (存量客户端升级需要注意:升级后需要将配置项 "xxl.job.admin.addresses" 中的 context-path 前缀移除) - 3、【优化】任务参数长度调整,最长支持2048字符; - 4、【升级】调度中心UI交互优化,任务及日志管理支持下拉框模糊搜索,提升交互体验; -- 5、【TODO】调度中心OpenAPI完善,提供任务管理能力;封装Agent Skill并推送ClawHub; -- 6、【TODO】AccessToken升级:执行器维度隔离,支持线上化配置;升级双端OpenApi,适配AccessToken升级; +- 5、【修复】XxlJobFileAppender自定义地址callbackLogPath设置无效问题修复;合并ISSUS-3963; +- 6、【TODO】调度中心OpenAPI完善,提供任务管理能力;封装Agent Skill并推送ClawHub; +- 7、【TODO】AccessToken升级:执行器维度隔离,支持线上化配置;升级双端OpenApi,适配AccessToken升级; ### TODO LIST diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java b/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java index b1b9f4a8..7d61be12 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java @@ -34,8 +34,8 @@ public class XxlJobFileAppender { * */ private static String logBasePath = "/data/applogs/xxl-job/jobhandler"; - private static String glueSrcPath = logBasePath.concat(File.separator).concat("gluesource"); - private static String callbackLogPath = logBasePath.concat(File.separator).concat("callbacklogs"); + private static String glueSrcPath = new File(logBasePath, "gluesource").getPath(); + private static String callbackLogPath = new File(logBasePath, "callbacklogs").getPath(); public static void initLogPath(String logPath) throws IOException { // init if (StringTool.isNotBlank(logPath)) { diff --git a/xxl-job-core/src/test/java/com/xxl/job/core/log/XxlJobFileAppenderTest.java b/xxl-job-core/src/test/java/com/xxl/job/core/log/XxlJobFileAppenderTest.java index 0ea197ff..d1be44c7 100644 --- a/xxl-job-core/src/test/java/com/xxl/job/core/log/XxlJobFileAppenderTest.java +++ b/xxl-job-core/src/test/java/com/xxl/job/core/log/XxlJobFileAppenderTest.java @@ -1,18 +1,3 @@ -/* - * Copyright 1999-2026 xuxueli.com - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package com.xxl.job.core.log; import org.junit.jupiter.api.Test; @@ -25,31 +10,27 @@ import java.nio.file.Path; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -/** - * Regression test for issue #3959: - * initLogPath should refresh callbackLogPath together with logBasePath and glueSrcPath. - */ -class XxlJobFileAppenderTest { +public class XxlJobFileAppenderTest { @Test - void initLogPath_shouldRefreshCallbackLogPathRelativeToCustomLogBase(@TempDir Path tempDir) throws IOException { + void callbacklogs_test(@TempDir Path tempDir) throws IOException { String customLogPath = tempDir.toFile().getPath(); XxlJobFileAppender.initLogPath(customLogPath); File expectedCallbackDir = new File(customLogPath, "callbacklogs"); assertEquals(expectedCallbackDir.getPath(), XxlJobFileAppender.getCallbackLogPath(), - "callbackLogPath should sit under the user-supplied logPath after initLogPath"); + "callbacklogs should be located below the user-specified directory"); } @Test - void initLogPath_shouldRefreshGlueSrcPathRelativeToCustomLogBase(@TempDir Path tempDir) throws IOException { + void gluesource_test(@TempDir Path tempDir) throws IOException { String customLogPath = tempDir.toFile().getPath(); XxlJobFileAppender.initLogPath(customLogPath); File expectedGlueDir = new File(customLogPath, "gluesource"); - assertEquals(expectedGlueDir.getPath(), XxlJobFileAppender.getGlueSrcPath()); - assertTrue(expectedGlueDir.exists(), "gluesource directory should be created under custom logPath"); + assertEquals(expectedGlueDir.getPath(), XxlJobFileAppender.getGlueSrcPath(), + "gluesource should be located below the user-specified directory"); } }