https://github.com/luka-mladenovic/logging-tap
Adds logging tap functionality to older Laravel versions
https://github.com/luka-mladenovic/logging-tap
laravel-5-package laravel-logging logging
Last synced: 5 months ago
JSON representation
Adds logging tap functionality to older Laravel versions
- Host: GitHub
- URL: https://github.com/luka-mladenovic/logging-tap
- Owner: luka-mladenovic
- License: mit
- Created: 2019-03-16T12:43:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T16:05:57.000Z (over 7 years ago)
- Last Synced: 2025-11-27T15:24:42.938Z (7 months ago)
- Topics: laravel-5-package, laravel-logging, logging
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel logging tap
Adds a [logging tap](https://laravel.com/docs/5.6/logging#advanced-monolog-channel-customization) functionality to Laravel versions from 5.0 to 5.3.
## Installation
Install the package using Composer.
```
composer require lukam/logging-tap
```
Open up `config/app.php` and add the service provider to your existing `providers` array.
```php
'providers' => [
LoggingTap\LogServiceProvider::class
]
```
## Usage
Create a new logging tap using the artisan `make:tap` command. This will create a new tap file inside the `App\Logging` folder.
```
php artisan make:tap ExampleTap
```
Open up `config/app.php`, scroll down to "Logging Configuration" and add a `log_tap` array entry. Add your logging tap classes to this array. Any classes in this array will customize the Monolog instance when created.
```php
'log_tap' => [App\Taps\ExampleTap::class],
```
For more information on how to work with logging taps refer to Laravel's [logging documentation](https://laravel.com/docs/5.6/logging#advanced-monolog-channel-customization).
## Examples
Create a logging tap to push a processor to Monolog instance:
```php
getMonolog()->pushProcessor(new UidProcessor);
}
}
```
Set Monolog instance formatter:
```php
getHandlers() as $handler) {
$handler->setFormatter($formatter);
}
}
```
## Testing
```
phpunit
```
## License
The MIT License (MIT). See the license file for more information.