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->setUsername($params['username']);
$options->setPassword($params['password']); $options->setPassword($params['password']);
$options->setTo($params['domain']); $options->setTo($params['domain']);
$options->setLogger($this->container['logger']);
$client = new Client($options); $client = new Client($options);

View File

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

View File

@@ -9,7 +9,7 @@
"fabiang/xmpp" : "0.6.1", "fabiang/xmpp" : "0.6.1",
"fguillot/json-rpc" : "0.0.3", "fguillot/json-rpc" : "0.0.3",
"fguillot/picodb" : "0.0.3", "fguillot/picodb" : "0.0.3",
"fguillot/simpleLogger" : "0.0.1", "fguillot/simpleLogger" : "0.0.2",
"fguillot/simple-validator" : "0.0.3", "fguillot/simple-validator" : "0.0.3",
"lusitanian/oauth" : "0.3.5", "lusitanian/oauth" : "0.3.5",
"nickcernis/html-to-markdown" : "2.2.1", "nickcernis/html-to-markdown" : "2.2.1",

63
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "d9fb1c5d3bbca8db5851cef5bb5473e5", "hash": "4aed9321378ab6e96c0fd0170b379c38",
"packages": [ "packages": [
{ {
"name": "christian-riesen/base32", "name": "christian-riesen/base32",
@@ -370,16 +370,16 @@
}, },
{ {
"name": "fguillot/simpleLogger", "name": "fguillot/simpleLogger",
"version": "v0.0.1", "version": "v0.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fguillot/simpleLogger.git", "url": "https://github.com/fguillot/simpleLogger.git",
"reference": "81df5643931d97e0101b4757d9454dbcb13a3fa9" "reference": "97bc14002f18d2fc18ee124c877ac3e55b3fa88b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fguillot/simpleLogger/zipball/81df5643931d97e0101b4757d9454dbcb13a3fa9", "url": "https://api.github.com/repos/fguillot/simpleLogger/zipball/97bc14002f18d2fc18ee124c877ac3e55b3fa88b",
"reference": "81df5643931d97e0101b4757d9454dbcb13a3fa9", "reference": "97bc14002f18d2fc18ee124c877ac3e55b3fa88b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -403,7 +403,7 @@
], ],
"description": "PHP library to write logs (compatible with PSR-3)", "description": "PHP library to write logs (compatible with PSR-3)",
"homepage": "https://github.com/fguillot/simpleLogger", "homepage": "https://github.com/fguillot/simpleLogger",
"time": "2015-01-02 03:40:21" "time": "2015-05-30 19:25:09"
}, },
{ {
"name": "lusitanian/oauth", "name": "lusitanian/oauth",
@@ -651,21 +651,20 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v2.6.7", "version": "v2.7.0",
"target-dir": "Symfony/Component/Console",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Console.git", "url": "https://github.com/symfony/Console.git",
"reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272" "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/ebc5679854aa24ed7d65062e9e3ab0b18a917272", "url": "https://api.github.com/repos/symfony/Console/zipball/7f0bec04961c61c961df0cb8c2ae88dbfd83f399",
"reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272", "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.9"
}, },
"require-dev": { "require-dev": {
"psr/log": "~1.0", "psr/log": "~1.0",
@@ -681,11 +680,11 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.6-dev" "dev-master": "2.7-dev"
} }
}, },
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Symfony\\Component\\Console\\": "" "Symfony\\Component\\Console\\": ""
} }
}, },
@@ -705,25 +704,24 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2015-05-02 15:18:45" "time": "2015-05-29 16:22:24"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v2.6.7", "version": "v2.7.0",
"target-dir": "Symfony/Component/EventDispatcher",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/EventDispatcher.git", "url": "https://github.com/symfony/EventDispatcher.git",
"reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02" "reference": "687039686d0e923429ba6e958d0baa920cd5d458"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/672593bc4b0043a0acf91903bb75a1c82d8f2e02", "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/687039686d0e923429ba6e958d0baa920cd5d458",
"reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02", "reference": "687039686d0e923429ba6e958d0baa920cd5d458",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.9"
}, },
"require-dev": { "require-dev": {
"psr/log": "~1.0", "psr/log": "~1.0",
@@ -740,11 +738,11 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.6-dev" "dev-master": "2.7-dev"
} }
}, },
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Symfony\\Component\\EventDispatcher\\": "" "Symfony\\Component\\EventDispatcher\\": ""
} }
}, },
@@ -764,27 +762,26 @@
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2015-05-02 15:18:45" "time": "2015-05-02 15:21:08"
} }
], ],
"packages-dev": [ "packages-dev": [
{ {
"name": "symfony/stopwatch", "name": "symfony/stopwatch",
"version": "v2.6.7", "version": "v2.7.0",
"target-dir": "Symfony/Component/Stopwatch",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Stopwatch.git", "url": "https://github.com/symfony/Stopwatch.git",
"reference": "b470f87c69837cb71115f1fa720388bb19b63635" "reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b470f87c69837cb71115f1fa720388bb19b63635", "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/7702945bceddc0e1f744519abb8a2baeb94bd5ce",
"reference": "b470f87c69837cb71115f1fa720388bb19b63635", "reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.9"
}, },
"require-dev": { "require-dev": {
"symfony/phpunit-bridge": "~2.7" "symfony/phpunit-bridge": "~2.7"
@@ -792,11 +789,11 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.6-dev" "dev-master": "2.7-dev"
} }
}, },
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Symfony\\Component\\Stopwatch\\": "" "Symfony\\Component\\Stopwatch\\": ""
} }
}, },
@@ -816,7 +813,7 @@
], ],
"description": "Symfony Stopwatch Component", "description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2015-05-02 15:18:45" "time": "2015-05-02 15:21:08"
} }
], ],
"aliases": [], "aliases": [],