astrotomic/laravel-monolog-config
最新稳定版本:1.4.0
Composer 安装命令:
composer require astrotomic/laravel-monolog-config
包简介
Simple Configuration Package for Monolog in Laravel.
README 文档
README
This package provides a simple way to configure monolog in Laravel/Lumen.
Installation
Step 1
Add it on your composer.json
"astrotomic/laravel-monolog-config": "^1.0"
and run
composer update
or run
composer require astrotomic/laravel-monolog-config
Step 2
Add the following string to config/app.php
Providers array:
\Astrotomic\MonologConfig\MonologConfigServiceProvider::class,
Step 3
Publish the configuration for monolog with the following command:
php artisan vendor:publish --provider="Astrotomic\MonologConfig\MonologConfigServiceProvider"
And adjust all the configurations to your needs.
Step 4
Use it as your monolog configuration tool. Add this to your bootstrap/app.php after the Interface bindings and before the return:
/* |-------------------------------------------------------------------------- | Configure Monolog |-------------------------------------------------------------------------- */ $app->configureMonologUsing(function (Monolog\Logger $monolog) { $configurator = new \Astrotomic\MonologConfig\MonologConfigurator($monolog); $configurator->run(); });
You can configure monolog after this your own in this method the normal Laravel way.
Handlers
At the moment this class supports the following handlers, if you need any other one just create a PR or write an issue.
v1.0.0
\Monolog\Handler\ErrorLogHandler\Monolog\Handler\GelfHandler\Monolog\Handler\LogglyHandler\Monolog\Handler\MandrillHandler\Monolog\Handler\MongoDBHandler\Monolog\Handler\NativeMailerHandler\Monolog\Handler\RotatingFileHandler\Monolog\Handler\StreamHandler\Monolog\Handler\SyslogHandler
v1.1.0
\Monolog\Handler\HipChatHandler\Monolog\Handler\IFTTTHandler\Monolog\Handler\LogEntriesHandler\Monolog\Handler\NullHandler\Monolog\Handler\RedisHandler\Monolog\Handler\ZendMonitorHandler
v1.3.0
\Monolog\Handler\SlackHandler\Monolog\Handler\SlackWebhookHandler\Monolog\Handler\SlackbotHandler
统计信息
- 总下载量: 38.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-28