fix: product env can't output log to console #114

This commit is contained in:
tjq 2020-11-27 22:41:25 +08:00
parent 08f8a1141e
commit 39ae41d531
2 changed files with 9 additions and 8 deletions

View File

@ -2,18 +2,17 @@
<!-- 生产环境日志 -->
<configuration>
<!--默认配置-->
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<!--配置控制台(Console)-->
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<!--
日志路径,注意权限问题,否则无法打印日志。
大坑记录:`~/logs`不会在用户目录下创建文件夹,而是在项目目录下创建名为~的文件夹
-->
<property name="LOG_PATH" value="${user.home}/powerjob-server/logs"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<!-- 系统所有异常日志ERROR双写 start -->
<appender name="ERROR_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">

View File

@ -1,6 +1,8 @@
package com.github.kfcfans.powerjob.server.test;
import com.github.kfcfans.powerjob.common.InstanceStatus;
import com.github.kfcfans.powerjob.common.TimeExpressionType;
import com.github.kfcfans.powerjob.common.WorkflowInstanceStatus;
import com.github.kfcfans.powerjob.common.utils.NetUtils;
import com.github.kfcfans.powerjob.server.common.constans.SwitchableStatus;
import com.github.kfcfans.powerjob.server.persistence.core.model.InstanceInfoDO;
@ -104,12 +106,12 @@ public class RepositoryTest {
@Test
public void testDeleteInstanceInfo() {
instanceInfoRepository.deleteAllByGmtModifiedBefore(new Date());
instanceInfoRepository.deleteAllByGmtModifiedBeforeAndStatusIn(new Date(), InstanceStatus.finishedStatus);
}
@Test
public void testDeleteWorkflowInstanceInfo() {
workflowInstanceInfoRepository.deleteAllByGmtModifiedBefore(new Date());
workflowInstanceInfoRepository.deleteAllByGmtModifiedBeforeAndStatusIn(new Date(), WorkflowInstanceStatus.finishedStatus);
}
}