summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/Logging.php
blob: 9737cadc147473a566406bf048f9aceb51111465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
    }
}