Skip to content

Commit 9fd757d

Browse files
Add logging Rollbar API connectivity problems
1 parent 543d186 commit 9fd757d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/RollbarServiceProvider.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,18 @@ public function boot()
4141
$context = $args[2];
4242
}
4343

44-
$app['Rollbar\Laravel\RollbarLogHandler']->log($level, $message, $context);
44+
if (strpos($message, 'Unable to send messages to Rollbar API. Produced response: ') !== false) {
45+
return;
46+
}
47+
48+
$result = $app[RollbarLogHandler::class]->log($level, $message, $context);
49+
50+
if (!$result->getStatus()) {
51+
\Log::error(
52+
'Unable to send messages to Rollbar API. Produced response: ' .
53+
print_r($result, true)
54+
);
55+
}
4556
});
4657
}
4758

0 commit comments

Comments
 (0)