【xxljob报错】com.xxl.job.core.log.XxlJobFileAppender : No such file or directory

2024-05-25 14:51:06 浏览数 (1)

SpringBoot 项目使用 XXL-JOB,执行到

代码语言:javascript复制
XxlJobHelper.log("ip:" ip "  执行成功!! " number );

报错:

代码语言:javascript复制
com.xxl.job.core.log.XxlJobFileAppender : No such file or directory

找不到文件或文件夹

查看 com.xxl.job.core.log.XxlJobFileAppender 得知文件路径:

代码语言:javascript复制
public class XxlJobFileAppender {
	private static Logger logger = LoggerFactory.getLogger(XxlJobFileAppender.class);


/**
 * log base path
 *
 * strut like:
 * 	---/
 * 	---/gluesource/
 * 	---/gluesource/10_1514171108000.js
 * 	---/gluesource/10_1514171108000.js
 * 	---/2017-12-25/
 * 	---/2017-12-25/639.log
 * 	---/2017-12-25/821.log
 *
 */
private static String logBasePath = "/data/applogs/xxl-job/jobhandler";
private static String glueSrcPath = logBasePath.concat("/gluesource");
代码语言:javascript复制
private static String logBasePath = “/data/applogs/xxl-job/jobhandler”;

Linux 环境下 无权限创建文件夹 需手动在 根目录下 /data/applogs/xxl-job/jobhandler 创建这几个目录。

0 人点赞