Skip to content

Commit

Permalink
If slack log url not set then not log to slack (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
formsdev authored Aug 10, 2023
1 parent 8f84faf commit 7e75343
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
],

'slack' => [
'enabled' => env('LOG_SLACK_WEBHOOK_URL') ? true : false,
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'OpenForm Log',
Expand Down

0 comments on commit 7e75343

Please sign in to comment.