nix-logger / nix-logger-laravel
Nix Logger
Installs: 1 036
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/contracts: ^9.0|^10.0
- illuminate/support: ^9.0|^10.0
- monolog/monolog: ^2 || ^3
- nix-logger/nix-logger: ^1.1
- psr/log: ^3.0
Requires (Dev)
- laravel/pint: ^1.13
This package is not auto-updated.
Last update: 2024-05-05 03:28:35 UTC
README
Installation
Install the nix-logger/nix-logger-laravel
package:
composer require nix-logger/nix-logger-laravel
Add the service provider to the providers
array in config/app.php
before your AppServiceProvider::class
NixLogger\Laravel\NixLoggerServiceProvider::class,
Add the Facade to the aliases
array in config/app.php
'NixLogger' => NixLogger\Laravel\Facades\NixLogger::class,
Configuration
Configure your Nix-Logger by edit the .env
file
# .env
NIX_LOGGER_API_KEY=
APP_ENV=
NIX_LOGGER_LEVEL=critical,error,warning
If you’d like to configure Nix-Logger further, create and edit a config/nix-logger.php
file
Setting Log report
In config/logging.php
, add the nix-logger
logging channel by adding the following under the channels
key:
'stack' => [ 'driver' => 'stack', 'channels' => ['single', 'nix-logger'], 'ignore_exceptions' => false, ], 'nix-logger' => [ 'driver' => 'custom', 'via' => \NixLogger\Laravel\Logger\NixLogger::class, ],
For stderr
'channels' => [ 'stderr' => [ 'driver' => 'monolog', 'level' => env('LOG_LEVEL', 'debug'), 'handler' => \NixLogger\Laravel\Handlers\NixLoggerStreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ 'stream' => 'php://stderr', ], 'processors' => [PsrLogMessageProcessor::class], ], ]
Usage
\NixLogger::debug('Test');