You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When caching your Laravel configs using artisan config:cache the Rollbar logger breaks:
Unable to create configured logger. Using emergency logger. {"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Unresolvable dependency resolving [Parameter #0 [ <required> array $config ]] in class Rollbar\\RollbarLogger at vendor/laravel/framework/src/Illuminate/Container/Container.php:948)
The problem is in the stopping condition of the service provider: https://github.com/rollbar/rollbar-php-laravel/blob/master/src/RollbarServiceProvider.php#L93. getenv always returns NULL when a cached config exists (which is good). Therefore, the Rollbar token is received from the config using key logging.channels.rollbar.token. However, the access token is stored under a different config key: logging.channels.rollbar.access_token. The result is that stop() returns true and the Rollbar logger never gets registered in the service container.
A workaround is to also include the token key in the config array:
Thanks for the report. We're planning to spend some time working on Laravel in the next week or so and should be able to review that PR and follow up on this issue.
When caching your Laravel configs using
artisan config:cache
the Rollbar logger breaks:The problem is in the stopping condition of the service provider: https://github.com/rollbar/rollbar-php-laravel/blob/master/src/RollbarServiceProvider.php#L93.
getenv
always returnsNULL
when a cached config exists (which is good). Therefore, the Rollbar token is received from the config using keylogging.channels.rollbar.token
. However, the access token is stored under a different config key:logging.channels.rollbar.access_token
. The result is thatstop()
returns true and the Rollbar logger never gets registered in the service container.A workaround is to also include the
token
key in the config array:The text was updated successfully, but these errors were encountered: