https://www.cnblogs.com/wuyongyin/p/14242162.html
@Component public class TestJob { protected static Logger logger = LoggerFactory.getLogger(TestJob.class); @XxlJob("testJobHandler") public ReturnT<String> testJobHandler(String param) throws Exception { XxlJobLogger.log("test-JOB, Hello World."); for (int i = 0; i < 5; i++) { //XxlJobLogger打印的日志可以在控制台查看 XxlJobLogger.log("beat at:" + i); logger.info("beat at:" + i); TimeUnit.SECONDS.sleep(2); } return ReturnT.SUCCESS; } }