{"record":{"id":"a79886c9f380d805","repo":"xuxueli/xxl-job","slug":"xxl-job-logpath-cannot-be-empty","errorCode":null,"errorMessage":"xxl-job logPath cannot be empty","messagePattern":"xxl-job logPath cannot be empty","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java","lineNumber":46,"sourceCode":"\t * strut like:\n\t * \t---/\n\t * \t---/gluesource/10_1514171108000.js\n\t * \t---/callbacklogs/xxl-job-callback-1761412677119.log\n\t * \t---/2017-12-25/639.log\n\t * \t---/2017-12-25/821.log\n\t *\n\t */\n\tprivate static String logBasePath;\n\tprivate static String glueSrcPath;\n\tprivate static String callbackLogPath;\n\n\t/**\n\t * init log path\n\t */\n\tpublic static void initLogPath(String logPath) throws IOException {\n\t\t// init\n\t\tif (StringTool.isBlank(logPath)) {\n\t\t\tthrow new RuntimeException(\"xxl-job logPath cannot be empty\");\n\t\t}\n\t\tlogBasePath = logPath.trim();\n\n\t\t// mk base dir\n\t\tFile logPathDir = new File(logBasePath);\n        FileTool.createDirectories(logPathDir);\n\t\tlogBasePath = logPathDir.getPath();\n\n\t\t// mk glue dir\n\t\tFile glueBaseDir = new File(logPathDir, \"gluesource\");\n        FileTool.createDirectories(glueBaseDir);\n\t\tglueSrcPath = glueBaseDir.getPath();\n\n\t\t// mk callback log dir\n\t\tFile callbackBaseDir = new File(logPathDir, \"callbacklogs\");\n        FileTool.createDirectories(callbackBaseDir);\n\t\tcallbackLogPath = callbackBaseDir.getPath();\n\t}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/xuxueli/xxl-job/blob/e74c784f68f81fa89cb350913ef15794865d7b12/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java#L28-L64","documentation":"Thrown by XxlJobFileAppender.initLogPath as a RuntimeException when the supplied logPath is blank. The appender needs a concrete base directory to create the log tree and glue source dir, so an empty path aborts initialization.","triggerScenarios":"Calling initLogPath(\"\") or initLogPath(null) (blank per StringTool.isBlank), typically via XxlJobExecutor.start() passing its logPath field which was unset (xxl.job.executor.logpath missing).","commonSituations":"xxl.job.executor.logpath omitted from configuration; env var for the log path not injected in a container; custom executor setup that skips setting logPath.","solutions":["Set xxl.job.executor.logpath (or setLogPath) to a writable absolute path, e.g. \"/data/applogs/xxl-job/jobhandler\".","Confirm the directory is writable by the executor process.","Inject the path via env var in containerized deployments."],"exampleFix":"// before\nxxlJobExecutor.setLogPath(\"\");\n// after\nxxlJobExecutor.setLogPath(\"/data/applogs/xxl-job/jobhandler\");","handlingStrategy":"validation","validationCode":"String logPath = config.getLogPath();\nif (StringTool.isBlank(logPath)) {\n    throw new IllegalStateException(\"xxl.job.executor.logpath is required\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    XxlJobFileAppender.initLogPath(logPath);\n} catch (RuntimeException e) {\n    log.error(\"log path init failed: {}\", e.getMessage());\n}","preventionTips":["Mark logPath @NotBlank in config properties.","Point logPath at a writable, durable local directory.","Fail boot early if the log path is unset."],"tags":["logging","configuration","filesystem","startup"],"backgroundTag":null,"analyzedSha":"e74c784f68f81fa89cb350913ef15794865d7b12","analyzedAt":"2026-08-14T04:22:43.715Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}