77 lines
2.6 KiB
PHP
77 lines
2.6 KiB
PHP
<?php
|
||
/**
|
||
* This file is part of webman.
|
||
*
|
||
* Licensed under The MIT License
|
||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||
* Redistributions of files must retain the above copyright notice.
|
||
*
|
||
* @author walkor<walkor@workerman.net>
|
||
* @copyright walkor<walkor@workerman.net>
|
||
* @link http://www.workerman.net/
|
||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||
*/
|
||
|
||
return [
|
||
'default' => [
|
||
'handlers' => [
|
||
[
|
||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||
'constructor' => [
|
||
runtime_path() . '/logs/webman.log',
|
||
7, //$maxFiles
|
||
Monolog\Logger::DEBUG,
|
||
],
|
||
'formatter' => [
|
||
'class' => Monolog\Formatter\LineFormatter::class,
|
||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||
],
|
||
]
|
||
],
|
||
],
|
||
/**
|
||
* 游戏 WebSocket 推送链路专用日志(独立通道):
|
||
* - 写入 runtime/logs/ws-YYYY-MM-DD.log,保留 7 天
|
||
* - 通过 Log::channel('ws')->info(...) 访问
|
||
* - 记录维度:publish 入队、queue 消费、按 topic/user_id 分发、心跳与连接生命周期、握手鉴权失败等
|
||
*/
|
||
'ws' => [
|
||
'handlers' => [
|
||
[
|
||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||
'constructor' => [
|
||
runtime_path() . '/logs/ws.log',
|
||
7,
|
||
Monolog\Logger::DEBUG,
|
||
],
|
||
'formatter' => [
|
||
'class' => Monolog\Formatter\LineFormatter::class,
|
||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||
],
|
||
],
|
||
],
|
||
],
|
||
/**
|
||
* 游戏实时对局卡住诊断(独立通道):
|
||
* - 写入 runtime/logs/game-live-stuck-YYYY-MM-DD.log,保留 7 天
|
||
* - 由 GameLiveStuckDiagnostic 在 recoverLiveRoundState 后巡检写入
|
||
* - 字段含 phase(卡住阶段)、db_status、stuck_sec、hint 等,便于 grep
|
||
*/
|
||
'game_live_stuck' => [
|
||
'handlers' => [
|
||
[
|
||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||
'constructor' => [
|
||
runtime_path() . '/logs/game-live-stuck.log',
|
||
7,
|
||
Monolog\Logger::DEBUG,
|
||
],
|
||
'formatter' => [
|
||
'class' => Monolog\Formatter\LineFormatter::class,
|
||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||
],
|
||
],
|
||
],
|
||
],
|
||
];
|