https://github.com/thecodingmachine/monolog-universal-service-provider
Cross-framework module for monolog/monolog
https://github.com/thecodingmachine/monolog-universal-service-provider
Last synced: 3 months ago
JSON representation
Cross-framework module for monolog/monolog
- Host: GitHub
- URL: https://github.com/thecodingmachine/monolog-universal-service-provider
- Owner: thecodingmachine
- Created: 2016-10-20T14:31:54.000Z (over 9 years ago)
- Default Branch: 1.0
- Last Pushed: 2018-08-30T20:07:57.000Z (almost 8 years ago)
- Last Synced: 2025-02-16T12:30:28.661Z (over 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/thecodingmachine/monolog-universal-service-provider)
[](https://packagist.org/packages/thecodingmachine/monolog-universal-service-provider)
[](https://packagist.org/packages/thecodingmachine/monolog-universal-service-provider)
# Monolog universal module
This package integrates Monolog in any [container-interop](https://github.com/container-interop/service-provider) compatible framework/container.
## Installation
```
composer require thecodingmachine/monolog-universal-service-provider
```
Once installed, you need to register the [`TheCodingMachine\Monolog\MonologServiceProvider`](src/MonologServiceProvider.php) into your container.
If your container supports Puli integration, you have nothing to do. Otherwise, refer to your framework or container's documentation to learn how to register *service providers*.
## Introduction
This service provider is meant to integrate [Monolog](https://github.com/Seldaek/monolog) into any container compatible with container-interop/service-provider.
By default, this package creates a logger that logs in the PHP error log but you can easily add/change handlers.
## Expected values / services
This *service provider* expects the following configuration / services to be available:
| Name | Compulsory | Description |
|-----------------------------|------------|----------------------------------------|
| `monologHandlers` | *no* | An array of Monoog handlers. If not set, a default `ErrorLogHandler` will be used to log in the error log. |
## Provided services
This *service provider* provides the following services:
| Service name | Description |
|-----------------------------|--------------------------------------|
| `Monolog\Logger` | the Monolog logger |
| `Psr\Log\LoggerInterface` | This is a simple alias to the Monolog logger |
## Extended services
*None*
Project template courtesy of thecodingmachine/service-provider-template