Silence Flask access logs and retain PM2 logs for 3 days.

Stop werkzeug request spam into PM2 error files, truncate oversized logs, and install daily logrotate with 3-day retention.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-15 07:53:19 +08:00
parent 8ecc70a61c
commit 1e765f4b2b
7 changed files with 108 additions and 1 deletions
+5 -1
View File
@@ -23,10 +23,14 @@ echo ">>> force-close policy: gate=ON, binance/okx=OFF"
python3 scripts/sync_common_trading_env.py --apply-force-close-policy "${DRY[@]}"
if [[ ${#DRY[@]} -gt 0 ]]; then
echo "(dry-run, skip pm2 restart)"
echo "(dry-run, skip pm2 log policy + restart)"
exit 0
fi
echo ">>> pm2 log policy (silence leftover + 3-day retain)"
sed -i 's/\r$//' deploy/pm2_log_policy.sh 2>/dev/null || true
bash deploy/pm2_log_policy.sh
echo ">>> pm2 restart"
pm2 restart crypto_gate crypto_binance crypto_okx manual-trading-hub manual-agent-gate 2>/dev/null \
|| pm2 restart crypto-monitor-gate crypto-monitor-binance crypto-monitor-okx manual-trading-hub 2>/dev/null \