\App\Console\CommandsLogPrune

审计日志保留期清理命令

职责:按保留天数(--days 覆盖,默认读站点配置 log.keep_days,未配置 180) 分批删除五张日志表的过期行——分批(1000 行/批)防长事务与锁表, 幂等可重复执行。

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 命令签名与说明 $signature / $description / 表清单 分区 2 · 执行入口 handle └────────────────────────────────────────────────────────────┘

Summary

Methods
Properties
Constants
handle()
No public properties found
TABLES
No protected methods found
$signature
$description
N/A
No private methods found
No private properties found
N/A

Constants

TABLES

TABLES = ['td_log_sys_oper', 'td_log_user_login', 'td_log_sys_error', 'td_log_sys_denied', 'td_log_user_password']

清理对象:五张审计日志表(create_time 时间列)

Properties

$signature

$signature

命令签名

$description

$description

命令说明

Methods

handle()

handle() : int

执行保留期清理:逐表分批删除 create_time 早于保留期的行。

Returns

int —