1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/ServiceProvider/LoggingProvider.php

29 lines
596 B
PHP
Raw Normal View History

2015-01-16 14:23:05 +01:00
<?php
namespace ServiceProvider;
2015-08-16 17:04:56 +02:00
use Psr\Log\LogLevel;
2015-01-16 14:23:05 +01:00
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use SimpleLogger\Logger;
use SimpleLogger\Syslog;
use SimpleLogger\File;
class LoggingProvider implements ServiceProviderInterface
{
public function register(Container $container)
{
2015-08-16 17:04:56 +02:00
$syslog = new Syslog('kanboard');
$syslog->setLevel(LogLevel::ERROR);
2015-01-16 14:23:05 +01:00
$logger = new Logger;
2015-08-16 17:04:56 +02:00
$logger->setLogger($syslog);
2015-01-16 14:23:05 +01:00
if (DEBUG) {
2015-02-25 17:29:06 +01:00
$logger->setLogger(new File(DEBUG_FILE));
2015-01-16 14:23:05 +01:00
}
$container['logger'] = $logger;
}
}