imraj123's avatar

How to use mono log with slack in laravel

Hi all,

I am trying to use mono log for my error logs it stored in database ans displayed the errors in the ui but my requirements is to send the error log to mail and database

i have tried this for slack // Send errors to slack channel $monolog = Log::getMonolog(); if (!\App::environment('local')) { $slackHandler = new SlackWebhookHandler(env('SLACK_WEBHOOK'), '#development', 'App Alerts', false, 'warning', true, true, Logger::ERROR); } else { $slackHandler = new SlackWebhookHandler(env('SLACK_WEBHOOK'), '@wes', 'App Alerts', false, 'warning', true, true, Logger::ERROR); } $monolog->pushHandler($slackHandler);

but it returns error

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'App\Providers\Log' not found

can you help me out please

0 likes
0 replies

Please or to participate in this conversation.