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
@@ -3,6 +3,7 @@
namespace app\services\bet;
use app\models\bet\Bet;
use app\utils\Logger;
use freedom\utils\DiceUtil;
use freedom\utils\SocketSession;
@@ -33,6 +34,7 @@ class ToBetDiceService{
$time = time();
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
if ($toBetCheck['status'] == false){
Logger::warn(Logger::CAT_BET, 'dice_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;
@@ -90,6 +92,7 @@ class ToBetDiceService{
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
$numberTabAmount = string_to_array($numberTabInfo['dice_amount']);
if($res){
Logger::info(Logger::CAT_BET, 'dice_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']);
$totalAmountArray = DiceUtil::amountInc($numberTabAmount, $data);
$round = [
@@ -98,6 +101,7 @@ class ToBetDiceService{
];
$ws->to(SocketSession::HOUSE_NAME)->emit('allBetAmount',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
}else{
Logger::warn(Logger::CAT_BET, 'dice_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');