Skip to content

Commit f3e5dba

Browse files
2 parents 2840356 + 43862c8 commit f3e5dba

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ language: php
22
dist: trusty
33

44
php:
5+
- 7.2
6+
- 7.1
57
- 7.0
68
- 5.6
79
- 5.5

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ Add the service provider to the `'providers'` array in `config/app.php` (this pa
2222
Rollbar\Laravel\RollbarServiceProvider::class,
2323
```
2424

25+
### Disabling Laravel 5.5's auto-discovery
26+
27+
By default Rollbar Laravel supports auto-discovery. If you do not want to auto-discover the package add the following code to your `composer.json`:
28+
29+
```json
30+
"extra": {
31+
"laravel": {
32+
"dont-discover": [
33+
"rollbar/rollbar-laravel"
34+
]
35+
}
36+
},
37+
```
38+
39+
### Enabling / disabling Rollbar on specific environments
40+
41+
First, [disable auto-discovery](https://github.com/rollbar/rollbar-php-laravel/blob/master/README.md#disabling-laravel-55s-auto-discovery).
42+
2543
If you only want to enable Rollbar reporting for certain environments you can conditionally load the service provider in your `AppServiceProvider`:
2644

2745
```php

src/RollbarLogHandler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public function log($level, $message, array $context = [])
7575

7676
$context = $this->addContext($context);
7777

78+
// Workaround Laravel 5.5 moving exception from message into context
79+
if (! empty($context['exception']) && is_string($message)) {
80+
$message = $context['exception'];
81+
}
82+
7883
return $this->logger->log($level, $message, $context);
7984
}
8085

0 commit comments

Comments
 (0)