Skip to content

Commit c762d8b

Browse files
authored
Merge pull request #2 from timbroder/timbroder-patch-1
update readme with report example
2 parents 31bb7d7 + 3af1b87 commit c762d8b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,25 @@ To monitor exceptions, simply use the `Log` facade or helper:
7272
Log::error($exception->getMessage(), ['exception' => $exception]);
7373
```
7474

75+
This can be done in the ```report``` method in ```app/Exceptions/Handler.php```
76+
77+
```php
78+
/**
79+
* Report or log an exception.
80+
*
81+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
82+
*
83+
* @param \Exception $e
84+
* @return void
85+
*/
86+
public function report(Exception $e)
87+
{
88+
\Log::error($e->getMessage(), ['exception' => $e]);
89+
90+
return parent::report($e);
91+
}
92+
```
93+
7594
You can change the logs used by changing the log level in the config by modifying the env var.
7695

7796
```php

0 commit comments

Comments
 (0)