Sentinel icon indicating copy to clipboard operation
Sentinel copied to clipboard

[BUG] 发现配置的日志目录下,只会删除xxx.metrics.log.pid相关的日志,command-center.log和sentinel-record.log的日志都不会自动删除,导致文件夹下文件数超级多

Open hezhaoye opened this issue 2 years ago • 3 comments

[BUG] 发现配置的日志目录下,目前只会删除xxx.metrics.log.pid相关的日志,而command-center.log和sentinel-record.log的日志都不会自动删除,导致文件夹下文件数超级多,这个是否可以优化下?

hezhaoye avatar Nov 23 '23 09:11 hezhaoye

com.alibaba.csp sentinel-logging-slf4j ${sentinel.version}

sirius19 avatar Mar 26 '24 03:03 sirius19

不是,这项目是又没人维护了么,2023年的问题了

fangtaoli avatar Apr 29 '24 03:04 fangtaoli

可以写的shell脚本,并定时执行,用来删除几个月前的日志

#!/bin/bash

# 此方法的初衷是删除 alibaba sentinel 日志文件
# 时间尽量设置大一点以免删除其他服务运行日志
function csp_log_clean(){

	log_path="$1"
	if [ -d $log_path ]; then
		#删除超过100天的历史日志文件
		find $log_path -type f -name "*.log.*" -mtime +100 -delete
	fi
}

csp_log_clean '/home/my_server/logs'


LE-JB9029 avatar Jun 14 '24 09:06 LE-JB9029