logback-spring.xml 中cron具体配置给出完整logback-spring.xml 代码
时间: 2023-03-07 20:37:13 浏览: 135
spring定时任务所需jar包 slf4j-api-1.5.6.jar 和slf4j-log4j12-1.5.6.jar
<?xml version="1.0" encoding="UTF-8"?>
<configuration> <include resource="org/springframework/scheduling/quartz/quartz-context.xml" /> <springProfile name="quartz">
<bean id="logbackJob" class="ch.qos.logback.core.db.JobWithHistory">
<property name="dynamicSql" value="INSERT INTO LoggingEvent (timestmp, formatted_message, logger_name, level_string, thread_name, reference_flag, caller_filename, caller_class, caller_method, caller_line, event_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" />
</bean> <bean id="logbackTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="logbackJob" />
<property name="cronExpression" value="0 0 0 * * ?" />
</bean>
</springProfile></configuration>
阅读全文