diff options
Diffstat (limited to 'app/ServiceProvider/Logging.php')
-rw-r--r-- | app/ServiceProvider/Logging.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/ServiceProvider/Logging.php b/app/ServiceProvider/Logging.php new file mode 100644 index 00000000..9737cadc --- /dev/null +++ b/app/ServiceProvider/Logging.php @@ -0,0 +1,21 @@ +<?php + +namespace ServiceProvider; + +use Pimple\Container; +use Pimple\ServiceProviderInterface; +use Monolog\Logger; +use Monolog\Handler\StreamHandler; +use Monolog\Handler\SyslogHandler; + +class Logging implements ServiceProviderInterface +{ + public function register(Container $container) + { + $logger = new Logger('app'); + $logger->pushHandler(new StreamHandler(__DIR__.'/../../data/debug.log', Logger::DEBUG)); + $logger->pushHandler(new SyslogHandler('kanboard', LOG_USER, Logger::DEBUG)); + + $container['logger'] = $logger; + } +} |