Skip to content

Commit

Permalink
Set logger into services implementing LoggerAwareInterface
Browse files Browse the repository at this point in the history
[Closes #21]
  • Loading branch information
jakubskrz authored and fprochazka committed May 17, 2017
1 parent b95cebb commit e796300
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Kdyby/Monolog/DI/MonologExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ public function beforeCompile()
new Statement('Kdyby\Monolog\Handler\FallbackNetteHandler', [$config['name'], $builder->expand('%logDir%')])
]);
}

foreach ($builder->findByType('Psr\Log\LoggerAwareInterface') as $service) {
$service->addSetup('setLogger', ['@' . $this->prefix('logger')]);
}
}


Expand Down

0 comments on commit e796300

Please sign in to comment.