You can install the package via composer:
composer require rhyslees/log-channel-laravel
Add the following to your config\logging.php
file:
'channels' => [
...
'logchannel' => [
'driver' => 'custom',
'via' => \RhysLees\LogChannelLaravel\LogChannelLaravel::class,
'key' => env('LOG_CHANNEL_KEY', ''),
'app_id' => env('LOG_CHANNEL_APP_ID', ''),
'endpoint' => env('LOG_CHANNEL_ENDPOINT', 'https://logchannel.co.uk/api/app'),
],
...
],
Then add the channel to the stack:
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'logchannel'],
'ignore_exceptions' => false,
],
You can publish the config file with:
php artisan vendor:publish --tag="log-channel-laravel-config"
This is the contents of the published config file:
return [
'key' => env('LOG_CHANNEL_KEY', ''),
'app_id' => env('LOG_CHANNEL_APP_ID', ''),
'endpoint' => env('LOG_CHANNEL_ENDPOINT', 'https://logchannel.co.uk/api/app'),
];
Optionally, you can publish the views using
php artisan vendor:publish --tag="log-channel-laravel-views"
$logChannelLaravel = new RhysLees\LogChannelLaravel();
echo $logChannelLaravel->echoPhrase('Hello, RhysLees!');
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.