diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index c7bfedd357248604a8d71a5eaba6448368174ee9..e5c6587744b6a32b354e380a80ea83603f02c634 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -262,12 +262,12 @@ $config = array( 'factories' => array( 'worldcatconnection' => function ($sm) { $wc = new \VuFind\Connection\WorldCat(); - $wc->setLogger(\VuFind\Log\Logger::getInstance()); + $wc->setLogger($sm->get('Logger')); return $wc; }, 'worldcatutils' => function ($sm) { $wcu = new \VuFind\Connection\WorldCatUtils(); - $wcu->setLogger(\VuFind\Log\Logger::getInstance()); + $wcu->setLogger($sm->get('Logger')); return $wcu; }, ), @@ -275,6 +275,7 @@ $config = array( 'authmanager' => 'VuFind\Auth\Manager', 'cart' => 'VuFind\Cart', 'cachemanager' => 'VuFind\Cache\Manager', + 'logger' => 'VuFind\Log\Logger', 'recordloader' => 'VuFind\Record\Loader', 'searchspecsreader' => 'VuFind\Config\SearchSpecsReader', 'sessionmanager' => 'Zend\Session\SessionManager', diff --git a/module/VuFind/src/VuFind/Connection/Manager.php b/module/VuFind/src/VuFind/Connection/Manager.php index 9153f35ee07a7a8885f3460e623ea78eb2affc05..477e1d9afa63469673352a1552c01a9a7f217659 100644 --- a/module/VuFind/src/VuFind/Connection/Manager.php +++ b/module/VuFind/src/VuFind/Connection/Manager.php @@ -117,7 +117,7 @@ class Manager $index->setServiceLocator(self::$serviceLocator); // Set the logger: - $index->setLogger(\VuFind\Log\Logger::getInstance()); + $index->setLogger(self::$serviceLocator->get('Logger')); return $index; } diff --git a/module/VuFind/src/VuFind/Controller/CoverController.php b/module/VuFind/src/VuFind/Controller/CoverController.php index 3eb71a792bfe5250917aa898b2703e36e507840a..bc41c8a6e93d56b4be3a1d4dbbe5af9bea73192e 100644 --- a/module/VuFind/src/VuFind/Controller/CoverController.php +++ b/module/VuFind/src/VuFind/Controller/CoverController.php @@ -54,7 +54,7 @@ class CoverController extends AbstractBase ConfigReader::getConfig(), $this->getServiceLocator()->get('CacheManager')->getCacheDir() ); - $this->loader->setLogger(\VuFind\Log\Logger::getInstance()); + $this->loader->setLogger($this->getServiceLocator()->get('Logger')); } return $this->loader; } diff --git a/module/VuFind/src/VuFind/Log/Logger.php b/module/VuFind/src/VuFind/Log/Logger.php index 6b472a364500d7ce30b1a4ac06822009d504e782..a9db538efa8d80cd116611a80062bbf87d441684 100644 --- a/module/VuFind/src/VuFind/Log/Logger.php +++ b/module/VuFind/src/VuFind/Log/Logger.php @@ -204,20 +204,6 @@ class Logger extends BaseLogger } } - /** - * Get the logger instance. - * - * @return Logger - */ - public static function getInstance() - { - static $instance; - if (!$instance) { - $instance = new Logger(); - } - return $instance; - } - /** * Is one of the log writers listening for debug messages? (This is useful to * know, since some code can save time that would be otherwise wasted generating diff --git a/module/VuFind/src/VuFind/Search/Summon/Results.php b/module/VuFind/src/VuFind/Search/Summon/Results.php index 9441aca880466e4f193ce5a4cb3e77b696403cd2..c9f37078256c9b53368d4a7854c6f36b352d3420 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Results.php +++ b/module/VuFind/src/VuFind/Search/Summon/Results.php @@ -60,7 +60,7 @@ class Results extends BaseResults $id = isset($config->Summon->apiId) ? $config->Summon->apiId : null; $key = isset($config->Summon->apiKey) ? $config->Summon->apiKey : null; $conn = new SummonConnection($id, $key); - $conn->setLogger(\VuFind\Log\Logger::getInstance()); + $conn->setLogger($this->getServiceLocator()->get('Logger')); } return $conn; }