github: fix notices
[pharext/pharext.org] / app / Logger.php
1 <?php
2
3 namespace app;
4
5 use app\Config;
6
7 class Logger extends \Monolog\Logger
8 {
9 function __construct(Config $config, $channel) {
10 parent::__construct($channel);
11 foreach ($config->log->$channel as $logger) {
12 $reflection = new \ReflectionClass("Monolog\\Handler\\" . $logger->handler);
13 if (!empty($logger->args)) {
14 $handler = $reflection->newInstanceArgs($logger->args->toArray());
15 } else {
16 $handler = $reflection->newInstance();
17 }
18 $this->pushHandler($handler);
19 }
20 }
21 }