Skip to content

Commit

Permalink
Use updated Monolog handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturMoczulski committed Apr 11, 2018
1 parent 22a26b5 commit 006f955
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Provider/RollbarHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
namespace SymfonyRollbarBundle\Provider;

use Rollbar\Rollbar;
use Rollbar\Monolog\Handler\RollbarHandler as RollbarMonologHandler;

use Monolog\Logger;
use Symfony\Component\DependencyInjection\ContainerInterface;
use SymfonyRollbarBundle\DependencyInjection\SymfonyRollbarExtension;

Expand All @@ -23,9 +26,13 @@ public function __construct(ContainerInterface $container)
public function getHandler()
{
$config = $this->getContainer()->getParameter(SymfonyRollbarExtension::ALIAS . '.config');

Rollbar::init($config['rollbar'], false, false, false);
$handler = new \Monolog\Handler\RollbarHandler(Rollbar::$instance);

$handler = new RollbarMonologHandler(
Rollbar::logger(),
Logger::ERROR
);

return $handler;
}
Expand Down

0 comments on commit 006f955

Please sign in to comment.