summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/LoggingProvider.php
blob: 5b2cf5659202fbc451e9b0935b68b6994fd05881 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

namespace ServiceProvider;

use Pimple\Container;
use Pimple\ServiceProviderInterface;
use SimpleLogger\Logger;
use SimpleLogger\Syslog;
use SimpleLogger\File;

class LoggingProvider implements ServiceProviderInterface
{
    public function register(Container $container)
    {
        $logger = new Logger;
        $logger->setLogger(new Syslog('kanboard'));

        if (DEBUG) {
            $logger->setLogger(new File(__DIR__.'/../../data/debug.log'));
        }

        $container['logger'] = $logger;
    }
}