Skip to content

Commit c58895e

Browse files
committed
bug #559 Fix rollbar handler to use RollbarLogger with Monolog 2+ (websirnik, GromNaN)
This PR was merged into the 3.x branch. Discussion ---------- Fix `rollbar` handler to use `RollbarLogger` with Monolog 2+ | Q | A | ------------- | --- | Branch? | 3.x <!-- for features and bug --> | Bug fix? | yes | New feature? | o | Deprecations? | no | License | MIT Improves the compatibility with the latest Rollbar library. Rollbar has renamed their classes a while ago. Commits ------- b6f5d69 Update changelog 0c10c52 Use conditional class name depending on the Monolog version 93fc8f3 Update RollbarNotifier to RollbarLogger in DI
2 parents 344f262 + b6f5d69 commit c58895e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Unreleased
22

3+
## unreleased
4+
5+
* Fix `rollbar` handler to use `RollbarLogger` with Monolog 2+
6+
37
## 3.11.0 (2025-11-27)
48

59
* Reorganize files to match the "Reusable Bundles" structure

src/DependencyInjection/MonologExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
930930
} else {
931931
$config = $handler['config'] ?: [];
932932
$config['access_token'] = $handler['token'];
933-
$rollbar = new Definition('RollbarNotifier', [
933+
$rollbar = new Definition(Logger::API === 1 ? 'RollbarNotifier' : 'Rollbar\RollbarLogger', [
934934
$config,
935935
]);
936936
$rollbarId = 'monolog.rollbar.notifier.'.sha1(json_encode($config));

0 commit comments

Comments
 (0)