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 创建这几个目录。