From 4f2d3910857725474c3c0d15aa30ab1c2f06d728 Mon Sep 17 00:00:00 2001 From: Forms Dev Date: Thu, 10 Aug 2023 20:12:37 +0530 Subject: [PATCH] If slack log url not set then not log to slack --- app/Exceptions/Handler.php | 2 +- config/logging.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 0dc6d7b82..830207d67 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -70,7 +70,7 @@ public function report(Throwable $exception) public function render($request, Throwable $e) { - if ($this->shouldReport($e) && !in_array(\App::environment(),['testing'])) { + if ($this->shouldReport($e) && !in_array(\App::environment(),['testing']) && config('logging.channels.slack.enabled')) { Log::channel('slack')->error($e); } diff --git a/config/logging.php b/config/logging.php index a4912a9fc..0a97d16b8 100644 --- a/config/logging.php +++ b/config/logging.php @@ -55,6 +55,7 @@ ], 'slack' => [ + 'enabled' => env('LOG_SLACK_WEBHOOK_URL') ? true : false, 'driver' => 'slack', 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'OpenForm Log',