weew / app-monolog
Integration of the monolog/monolog package into weew/app package.
v1.12.0
2016-12-20 15:49 UTC
Requires
- monolog/monolog: ^1.18
- weew/app: ^2.0
Requires (Dev)
- henrikbjorn/phpspec-code-coverage: ^2.0
- phpspec/phpspec: ^2.4
- satooshi/php-coveralls: ^0.6.1
- weew/helpers-phpspec: ^1.0
README
Table of contents
Installation
composer require weew/app-monolog
Introduction
This package integrates the monolog/monolog library into the weew/php-app package.
Usage
To make monolog available inside the application, simply register MonologProvider
on the kernel.
$app->getKernel()->addProviders([ MonologProvider::class ]);
You can retrieve a specific logger by the channel name:
$channelManager = $app->getContainer()->get(IMonologChannelManager::class); $channelManager->getLogger('config_name');
Example config
This is how your configuration might look like:
monolog: channels: default: log_file_path: /var/logs/default.log log_level: debug error: log_file_path: /var/logs/error.log log_level: debug