feat: add logging module for backend + frontend error reporting

Backend:
- New Logger utility (app/utils/Logger.php) with category-based log files
  (connect/game/bet/error/frontend under runtime/log/)
- Log WebSocket connect/close events (WsConnect, WsClose)
- Log dealer auth success/failure (SpaceConnectService)
- Log all game events: startBet, endBet, changeBoot, opening for all 7 game types
- Log unhandled exceptions (ExceptionHandle)
- Separate SQL/error logs via apart_level, enable realtime_write for Swoole
- Add /log/report POST endpoint for frontend error ingestion

Frontend:
- New error-report.js with window.onerror + unhandledrejection auto-reporting
- Added to all 12 dealer HTML templates
- Bump VERSION_V to v10.1.0
This commit is contained in:
testadmin
2026-05-14 11:28:33 +08:00
parent 710bb45614
commit d77c6beac7
31 changed files with 168 additions and 7 deletions
+1
View File
@@ -292,6 +292,7 @@
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_b.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -205,6 +205,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -490,6 +490,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_b_sb_scan_four.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -124,6 +124,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_dice.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -233,6 +233,7 @@
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_b.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -174,6 +174,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -459,6 +459,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_dt_sb.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -345,6 +345,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -620,6 +620,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -620,6 +620,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_nn_sb.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -126,6 +126,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle_roulette.js{$Think.VERSION_V}"></script>
</body>
</html>
+1
View File
@@ -136,6 +136,7 @@
<script type="text/javascript" src="/static/handle/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/handle/js/layer-v3.1.1/layer.js"></script>
<script type="text/javascript" src="/static/handle/js/socket.io-1.4.4.js"></script>
<script type="text/javascript" src="/static/handle/js/error-report.js{$Think.VERSION_V}"></script>
<script type="text/javascript" src="/static/handle/js/handle.js{$Think.VERSION_V}"></script>
</body>
</html>