Update logger

This commit is contained in:
Frederic Guillot
2015-05-30 15:37:25 -04:00
parent 2e0eb62385
commit 94cbdb3d9b
4 changed files with 37 additions and 35 deletions

View File

@@ -106,6 +106,7 @@ class Jabber extends \Core\Base
$options->setUsername($params['username']);
$options->setPassword($params['password']);
$options->setTo($params['domain']);
$options->setLogger($this->container['logger']);
$client = new Client($options);

View File

@@ -2,6 +2,7 @@
namespace ServiceProvider;
use Psr\Log\LogLevel;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use SimpleLogger\Logger;
@@ -12,8 +13,11 @@ class LoggingProvider implements ServiceProviderInterface
{
public function register(Container $container)
{
$syslog = new Syslog('kanboard');
$syslog->setLevel(LogLevel::ERROR);
$logger = new Logger;
$logger->setLogger(new Syslog('kanboard'));
$logger->setLogger($syslog);
if (DEBUG) {
$logger->setLogger(new File(DEBUG_FILE));