radoslawkoziol/monolog-masstrade

Monolog MassTrade Handler

1.0.1 2021-01-13 08:23 UTC

This package is auto-updated.

Last update: 2024-11-13 16:43:42 UTC


README

  • install package
  • add log channel in Laravel config/logging.php
'masstrade' => [
     'driver' => 'custom',
     'via' => radoslawkoziol\MonologMassTrade\MasstradeLogger::class,
     'level' => 'debug'
],
  • daily channel must be also configured, if is not add
'daily' => [
    'driver' => 'daily',
    'path' => storage_path('logs/laravel.log'),
    'level' => 'debug',
    'days' => 7,
],
  • default logging channel CANNOT be set to masstrade
  • add in .env url to public api PUBLIC_API_MT_URL=https://public-api.masstrade.pl

USING

radoslawkoziol\MonologMassTrade\MassTradeLog::error($exception);

OPTIONAL

To get error handler working, add in file app/Exceptions/Handler.php

public function report(Throwable $exception)
{
    if ($this->shouldReport($exception)) {
        radoslawkoziol\MonologMassTrade\MassTradeLog::error($exception);
    }
    parent::report($exception);
}