adeattwood / yii2-log-viewer
用于查看日志文件的Yii 2模块
1
2017-07-22 15:58 UTC
Requires
- 2amigos/yii2-date-picker-widget: ^1.0
- yiisoft/yii2: ^2.0
This package is auto-updated.
Last update: 2024-09-12 07:30:46 UTC
README
此模块将yii2日志渲染成易于阅读的格式。该模块还提供排序和过滤功能。
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
composer require adeattwood/yii2-log-viewer
或
"adeattwood/yii2-log-viewer": "*"
将以下内容添加到您的 composer.json
文件的require部分。
配置
扩展安装完成后,只需按以下方式修改您的应用程序配置
return [ 'bootstrap' => [ 'log-viewer' ], 'modules' => [ 'log-viewer' => [ 'class' => 'adeattwood\logviewer\Module', // other configuration ], // ... ], // ... ];
现在您可以从 /log-viewer
访问该模块,在那里您可以查看日志表
其他配置
'log-viewer' => [ 'class' => 'adeattwood\logviewer\Module', 'logLimit' => 10000, // The amount of log items to send to the view. 'logCacheTime' => 30, // The amount of time the log items will be cached in seconds. 'pageCacheTime' => 30, // The amount of time the page html will be cached in seconds. 'tableColors' => true // Different colors for different log levels in the table. 'allowedIPs' => [ // The ip addressed allowed to access the logs view. '127.0.0.1', '192.168.0.*', '::1' ], ],