summaryrefslogtreecommitdiff
path: root/app/ServiceProvider
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-31 12:56:29 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-31 12:56:29 -0500
commit198f8d6a8e39fe7bb21faafe53b12e351feca8b7 (patch)
treebd625191515a7ffa7bd5226c51c18b5364d1e7c1 /app/ServiceProvider
parent772804add8095eea9b3ec2a832c2f82fbb9a6fd5 (diff)
Add debug option
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r--app/ServiceProvider/DatabaseProvider.php1
-rw-r--r--app/ServiceProvider/LoggingProvider.php7
2 files changed, 6 insertions, 2 deletions
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php
index 2ed87ace..632b0238 100644
--- a/app/ServiceProvider/DatabaseProvider.php
+++ b/app/ServiceProvider/DatabaseProvider.php
@@ -11,6 +11,7 @@ class DatabaseProvider implements ServiceProviderInterface
public function register(Container $container)
{
$container['db'] = $this->getInstance();
+ $container['db']->stopwatch = DEBUG;
}
/**
diff --git a/app/ServiceProvider/LoggingProvider.php b/app/ServiceProvider/LoggingProvider.php
index 93f55a9c..f5e70381 100644
--- a/app/ServiceProvider/LoggingProvider.php
+++ b/app/ServiceProvider/LoggingProvider.php
@@ -13,8 +13,11 @@ class LoggingProvider implements ServiceProviderInterface
public function register(Container $container)
{
$logger = new Logger('app');
- $logger->pushHandler(new StreamHandler(__DIR__.'/../../data/debug.log', Logger::DEBUG));
- $logger->pushHandler(new SyslogHandler('kanboard', LOG_USER, Logger::DEBUG));
+ $logger->pushHandler(new SyslogHandler('kanboard', LOG_USER, Logger::INFO));
+
+ if (DEBUG) {
+ $logger->pushHandler(new StreamHandler(__DIR__.'/../../data/debug.log', Logger::DEBUG));
+ }
$container['logger'] = $logger;
}