stryber / laravel-log-handler
Stryber Laravel Log Handler for Laravel Framework
Installs: 8 312
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- graylog2/gelf-php: ^1.6
- illuminate/contracts: ^8.0
- illuminate/http: ^8.0
- illuminate/log: ^8.0
- psr/log: ^1.1
- ramsey/uuid: ^4.0
- stryber/laravel-uuid-helper: ^8.0
Requires (Dev)
- roave/security-advisories: dev-master
- vimeo/psalm: ^4.6
README
Stryber Log Handler for Laravel
Table of Contents
Requirements
- PHP ^7.4
- Laravel ^7.0
Installation
composer require stryber/laravel-log-handler
Configuration
You can publish the config files with the following command:
php artisan vendor:publish --tag="stryber-logging"
Now you have 2 new config files: stryber-logging.php
and stryber-logging-middleware.php
The first one, stryber-logging.php
, is using to configure laravel logger and will be merged with your logging.php
config.
In most cases you dont need to change this file, so it's safe to delete or event don't publish.
The second one, stryber-logging-middleware.php
is using for populate Stryber\Logger\LoggerMiddleware
and collectors constructor params.
It already contains some widely used values, but you can change them to fit your project requirements as you want.
After configuration you will able to use Log::channel('stderr')
for logging errors and Log::channel('stdout')
for other logs. You should remove this channels from logging.php
configuration file if you have them.
To use logging middleware for logging every pair of request and response you should use Stryber\Logger\LoggerMiddleware
class
or it simple alias 'log'