Unverified Commit e8db2094 authored by Licho's avatar Licho Committed by GitHub

feat: add log delete strategy (#1956)

* feat: add log delete strategy Signed-off-by: 's avatarLicho <lecho.sun@gmail.com> * fix: log path --------- Signed-off-by: 's avatarLicho <lecho.sun@gmail.com>
parent 2a59585d
......@@ -33,6 +33,7 @@ import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.springframework.messaging.MessagingException;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;
......@@ -62,8 +63,8 @@ public class WatchTableServiceImpl implements WatchTableService {
if (destinations != null) {
destinations.forEach(d -> this.messagingTemplate.convertAndSend(d, data[1]));
}
} catch (Exception e) {
log.error(e.getMessage());
} catch (MessagingException e) {
log.error(e.toString());
}
}
......
......@@ -42,6 +42,17 @@
<!--当app.log文件大小到达100MB的时候,就归档一次日志文件,也就是把app.log中的那前面100MB文件取出来,放到上面<RollingFile >中的filePattern后面的路径中-->
<SizeBasedTriggeringPolicy size="100MB"/>
</Policies>
<DefaultRolloverStrategy>
<!--
* only files in the log folder, no sub folders
* only rolled over log files (name match)
* only files that are 4 days old or older
-->
<Delete basePath="${LOG_PATH}/" maxDepth="1">
<IfFileName glob="*-ws-.log"/>
<IfLastModified age="3d"/>
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
</appenders>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment