rhyslees / log-channel-laravel
This is my package log-channel-laravel
1.0.1
2023-03-24 17:06 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.13.0
Requires (Dev)
- laravel/pint: ^1.6
- nunomaduro/collision: ^7.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.x-dev
- pestphp/pest-plugin-laravel: ^2.x-dev
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^10.0
- spatie/laravel-ray: ^1.32
This package is auto-updated.
Last update: 2024-10-09 21:41:51 UTC
README
Installation
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"
Usage
As Log Channel
As Facade
$logChannelLaravel = new RhysLees\LogChannelLaravel(); echo $logChannelLaravel->echoPhrase('Hello, RhysLees!');
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.