feat: complete logging audit - fill all gaps

- Filter noisy audio play() errors from frontend log
- Add logging to ALL 8 ToBet services (was only Baccarat)
- Add InitTableService logging (Sumday/Boot/NumberTab creation & failure)
- Add logview.sh for quick log viewing
- Add log_cleanup.sh for 30-day rotation
This commit is contained in:
testadmin
2026-05-14 11:49:36 +08:00
parent 7fe15a0d50
commit a180fe8385
10 changed files with 124 additions and 6 deletions
+4
View File
@@ -4,6 +4,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\SocketSession;
/**
@@ -50,6 +51,7 @@ class ToBetTcService
$time = time();
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
if ($toBetCheck['status'] == false){
Logger::warn(Logger::CAT_BET, 'tc_bet_fail', ['table_id' => $tableInfo['id'], 'msg' => $toBetCheck['msg']]);
$ws->emit('toBet',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => $toBetCheck['msg']]);
SocketSession::resetRepeat($fd,'user','isToBet');
return;
@@ -182,9 +184,11 @@ class ToBetTcService
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
if($res){
Logger::info(Logger::CAT_BET, 'tc_bet_success', ['user_id' => $userInfo['id'], 'table_id' => $tableInfo['id'], 'amount' => $amount]);
$ws->emit('toBet',['status' => true, 'table_id' => $tableInfo['id'], 'bet_amount_msg' => $betTotalAmount, 'money' => ($userInfo['money'] - $amount),'seat_num' => $seat_num, 'msg' => 'to_bet_success']);
// 待确定是否推送即时彩池,现不推送
}else{
Logger::warn(Logger::CAT_BET, 'tc_bet_db_fail', ['user_id' => $userInfo['id'], 'table_id' => $tableInfo['id'], 'amount' => $amount]);
$ws->emit('toBet',['status' => false, 'table_id' => $tableInfo['id'], 'msg' => 'to_bet_fail']);
}
SocketSession::resetRepeat($fd,'user','isToBet');