/** * Registers services on the given container. * * This method should only be used to configure services and parameters. * It should not get services. * * @param Container $pimple An Container instance */ public function register(Container $pimple) { $pimple['logger'] = function () use($pimple) { $handler = array(); $level = $pimple['kernel']->isDebug() ? Logger::DEBUG : Logger::INFO; /** @var Application $pimple */ if ($pimple->getKernel()->isDevEnvironment()) { $handler[] = new StreamHandler('php://stdout', $level); } $handler[] = new RotatingFileHandler($pimple['config']['logging']['file'], $pimple['config']['logging']['rotate'], $level); return new Logger('kanoa', $handler); }; }