asuran/yii-monolog
最新稳定版本:v1.1.0
Composer 安装命令:
composer require asuran/yii-monolog
包简介
Extension for using monolog with yii 1.x
README 文档
README
Inspired by enlitepro/enlite-monolog and smartapps-fr/yii-monolog
Install
The recommended way to install is through composer from command line.
composer require asuran/yii-monolog
Usage
- Add the component to the preload list
<?php return [ 'preload' => [ 'monolog', ], ];
- Configure the component
<?php return [ 'components' => [ 'monolog' => [ 'class' => 'YiiMonolog\MonologComponent', 'name' => 'MyApplication', 'handlers' => [ 'file' => [ 'class' => 'Monolog\Handler\StreamHandler', 'stream' => '/runtime/app.log', 'formatter' => 'Monolog\Formatter\LineFormatter', ], ], 'processors' => [ 'Monolog\Processor\ProcessIdProcessor', ], ], ], ];
- Add log route
<?php return [ 'components' => [ 'log' => [ 'class' => 'CLogRouter', 'routes' => [ 'monolog' => [ 'class' => 'YiiMonolog\MonologLogRoute', ], ], ], ], ];
- Add exception handler
<?php return [ 'components' => [ 'errorHandler' => [ 'class' => 'YiiMonolog\MonologErrorHandler', 'errorAction' => 'site/error', ], ], ];
统计信息
- 总下载量: 7.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2017-02-14