adeattwood/yii2-log-viewer

用于查看日志文件的Yii 2模块

安装次数: 1,824

依赖者: 0

推荐者: 0

安全性: 0

星标: 3

关注者: 3

分支: 2

开放性问题: 0

语言:CSS

类型:项目

1 2017-07-22 15:58 UTC

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' 
    ],
],