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:
@@ -4,6 +4,7 @@
|
||||
namespace app\services\bet;
|
||||
|
||||
use app\models\bet\Bet;
|
||||
use app\utils\Logger;
|
||||
use freedom\utils\SocketSession;
|
||||
|
||||
/**
|
||||
@@ -36,6 +37,7 @@ class ToBetToningService
|
||||
$time = time();
|
||||
$toBetCheck = ToBetCommonService::toBetCheck($tableInfo,$event,$data);
|
||||
if ($toBetCheck['status'] == false){
|
||||
Logger::warn(Logger::CAT_BET, 'toning_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;
|
||||
@@ -89,6 +91,7 @@ class ToBetToningService
|
||||
$res = Bet::toBet($tableInfo,$userInfo,$numberTabInfo,$prevBetInfo,$data,$seat_num,$betTotalAmount,$time,0);
|
||||
$numberTabAmount = string_to_array($numberTabInfo['toning_amount']);
|
||||
if($res){
|
||||
Logger::info(Logger::CAT_BET, 'toning_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']);
|
||||
$round = array(
|
||||
'toning_zero' => isset($numberTabAmount['toning_zero']) ? intval($numberTabAmount['toning_zero'] + $data['toning_zero']) : $data['toning_zero'],
|
||||
@@ -113,6 +116,7 @@ class ToBetToningService
|
||||
);
|
||||
$ws->to(SocketSession::HOUSE_NAME)->emit('allBetAmount',['status' => true, 'table_id' => $tableInfo['id'], 'round' => $round]);
|
||||
}else{
|
||||
Logger::warn(Logger::CAT_BET, 'toning_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');
|
||||
|
||||
Reference in New Issue
Block a user