mirror of
https://github.com/YunoHost-Apps/kanboard_ynh.git
synced 2024-09-03 19:36:17 +02:00
28 lines
596 B
PHP
28 lines
596 B
PHP
<?php
|
|
|
|
namespace ServiceProvider;
|
|
|
|
use Psr\Log\LogLevel;
|
|
use Pimple\Container;
|
|
use Pimple\ServiceProviderInterface;
|
|
use SimpleLogger\Logger;
|
|
use SimpleLogger\Syslog;
|
|
use SimpleLogger\File;
|
|
|
|
class LoggingProvider implements ServiceProviderInterface
|
|
{
|
|
public function register(Container $container)
|
|
{
|
|
$syslog = new Syslog('kanboard');
|
|
$syslog->setLevel(LogLevel::ERROR);
|
|
|
|
$logger = new Logger;
|
|
$logger->setLogger($syslog);
|
|
|
|
if (DEBUG) {
|
|
$logger->setLogger(new File(DEBUG_FILE));
|
|
}
|
|
|
|
$container['logger'] = $logger;
|
|
}
|
|
}
|