Make IcingaWeb using the new log wrapper

refs #5683
This commit is contained in:
Johannes Meyer 2014-02-26 11:19:52 +01:00
parent 05cb0cb87a
commit 3555e66018
28 changed files with 104 additions and 89 deletions

View File

@ -28,13 +28,9 @@
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
// @codingStandardsIgnoreStart // @codingStandardsIgnoreStart
use Icinga\Web\Form;
use Icinga\Web\Controller\ActionController; use Icinga\Web\Controller\ActionController;
use Icinga\Filter\Filter; use Icinga\Filter\Filter;
use Icinga\Filter\FilterAttribute; use Icinga\Logger\Logger;
use Icinga\Filter\Type\TextFilter;
use Icinga\Application\Logger;
use Icinga\Web\Url;
/** /**
* Application wide interface for filtering * Application wide interface for filtering

View File

@ -29,10 +29,9 @@
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
use \Zend_Controller_Action_Exception as ActionException; use \Zend_Controller_Action_Exception as ActionException;
use \Icinga\Web\Controller\ActionController; use Icinga\Web\Controller\ActionController;
use \Icinga\Application\Icinga; use Icinga\Application\Icinga;
use \Icinga\Application\Config as IcingaConfig; use Icinga\Logger\Logger;
use \Icinga\Application\Logger;
/** /**
* Delivery static content to clients * Delivery static content to clients
@ -104,7 +103,8 @@ class StaticController extends ActionController
if (!Icinga::app()->getModuleManager()->hasEnabled($module)) { if (!Icinga::app()->getModuleManager()->hasEnabled($module)) {
Logger::error( Logger::error(
'Non-existing frontend component "' . $module . '/' . $file 'Non-existing frontend component "' . $module . '/' . $file
. '" was requested. The module "' . $module . '" does not exist or is not active.'); . '" was requested. The module "' . $module . '" does not exist or is not active.'
);
echo "/** Module not enabled **/"; echo "/** Module not enabled **/";
return; return;
} }
@ -115,7 +115,8 @@ class StaticController extends ActionController
if (!file_exists($filePath)) { if (!file_exists($filePath)) {
Logger::error( Logger::error(
'Non-existing frontend component "' . $module . '/' . $file 'Non-existing frontend component "' . $module . '/' . $file
. '" was requested, which would resolve to the the path: ' . $filePath); . '" was requested, which would resolve to the the path: ' . $filePath
);
echo '/** Module has no js files **/'; echo '/** Module has no js files **/';
return; return;
} }

View File

@ -30,9 +30,9 @@
namespace Icinga\Form\Config\Resource; namespace Icinga\Form\Config\Resource;
use \Zend_Config; use \Zend_Config;
use \Icinga\Web\Form; use Icinga\Web\Form;
use \Icinga\Web\Form\Decorator\HelpText; use Icinga\Logger\Logger;
use \Icinga\Application\Logger; use Icinga\Web\Form\Decorator\HelpText;
use Icinga\Data\ResourceFactory; use Icinga\Data\ResourceFactory;
/** /**
@ -440,7 +440,7 @@ class EditResourceForm extends Form
if ($key !== 'resource_type' && $key !== 'resource_all_name' && $key !== 'resource_all_name_old') { if ($key !== 'resource_type' && $key !== 'resource_all_name' && $key !== 'resource_all_name_old') {
$configKey = explode('_', $key, 3); $configKey = explode('_', $key, 3);
if (sizeof($configKey) < 3) { if (sizeof($configKey) < 3) {
Logger::warn('EditResourceForm: invalid form key "' . $key . '" was ignored.'); Logger::warning('EditResourceForm: invalid form key "' . $key . '" was ignored.');
continue; continue;
} }
$result[$configKey[2]] = $value; $result[$configKey[2]] = $value;

View File

@ -29,13 +29,15 @@
namespace Icinga\Application; namespace Icinga\Application;
use \DateTimeZone;
use \Exception; use \Exception;
use \Icinga\Application\Modules\Manager as ModuleManager; use \DateTimeZone;
use \Icinga\Application\Config; use \Zend_Config;
use \Icinga\Exception\ConfigurationError; use Icinga\Application\Modules\Manager as ModuleManager;
use \Icinga\Util\DateTimeFactory; use Icinga\Application\Config;
use \Icinga\Util\Translator; use Icinga\Exception\ConfigurationError;
use Icinga\Util\DateTimeFactory;
use Icinga\Util\Translator;
use Icinga\Logger\Logger;
use Icinga\Data\ResourceFactory; use Icinga\Data\ResourceFactory;
@ -262,10 +264,6 @@ abstract class ApplicationBootstrap
$application = new $class($configDir); $application = new $class($configDir);
$application->bootstrap(); $application->bootstrap();
if (Logger::hasErrorsOccurred()) {
$application->stopApplication(Logger::getQueue());
}
return $application; return $application;
} }
@ -359,14 +357,33 @@ abstract class ApplicationBootstrap
try { try {
$this->moduleManager->loadEnabledModules(); $this->moduleManager->loadEnabledModules();
} catch (Exception $e) { } catch (Exception $e) {
Logger::fatal(
'Could not load modules. An exception was thrown during bootstrap: %s',
$e->getMessage()
);
} }
return $this; return $this;
} }
/**
* Setup default logging
*
* @return self
*/
protected function setupLogging()
{
Logger::create(
new Zend_Config(
array(
'enable' => true,
'level' => Logger::$ERROR,
'type' => 'syslog',
'facility' => 'LOG_USER',
'application' => 'Icinga Web'
)
)
);
return $this;
}
/** /**
* Load Configuration * Load Configuration
* *
@ -391,7 +408,13 @@ abstract class ApplicationBootstrap
ini_set('display_startup_errors', 1); ini_set('display_startup_errors', 1);
ini_set('display_errors', 1); ini_set('display_errors', 1);
} }
Logger::create($this->config->logging);
try {
Logger::create($this->config->logging);
} catch (ConfigurationError $e) {
Logger::error($e);
}
return $this; return $this;
} }
@ -438,7 +461,7 @@ abstract class ApplicationBootstrap
try { try {
Translator::setupLocale($this->config->global->get('language', Translator::DEFAULT_LOCALE)); Translator::setupLocale($this->config->global->get('language', Translator::DEFAULT_LOCALE));
} catch (Exception $error) { } catch (Exception $error) {
Logger::info($error->getMessage()); Logger::error($error);
} }
$localeDir = $this->getApplicationDir('locale'); $localeDir = $this->getApplicationDir('locale');

View File

@ -61,11 +61,12 @@ class Cli extends ApplicationBootstrap
protected function bootstrap() protected function bootstrap()
{ {
$this->assertRunningOnCli(); $this->assertRunningOnCli();
$this->setupConfig() $this->setupLogging()
->setupInternationalization() ->setupConfig()
->parseBasicParams()
->fixLoggingConfig() ->fixLoggingConfig()
->setupErrorHandling() ->setupErrorHandling()
->setupInternationalization()
->parseBasicParams()
->setupResourceFactory() ->setupResourceFactory()
->setupModuleManager(); ->setupModuleManager();
} }
@ -74,13 +75,9 @@ class Cli extends ApplicationBootstrap
{ {
$conf = & $this->getConfig()->logging; $conf = & $this->getConfig()->logging;
if ($conf->type === 'stream') { if ($conf->type === 'stream') {
$conf->verbose = $this->verbose; $conf->level = $this->verbose;
$conf->target = 'php://stderr'; $conf->target = 'php://stderr';
} }
if ($conf->debug && $conf->debug->type === 'stream') {
$conf->debug->target = 'php://stderr';
$conf->debug->enable = $this->debug;
}
return $this; return $this;
} }

View File

@ -31,7 +31,7 @@ namespace Icinga\Application\Modules;
use Icinga\Application\ApplicationBootstrap; use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Data\DataArray\Datasource as ArrayDatasource; use Icinga\Data\DataArray\Datasource as ArrayDatasource;
use Icinga\Data\DataArray\Query as ArrayQuery; use Icinga\Data\DataArray\Query as ArrayQuery;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
@ -161,7 +161,7 @@ class Manager
$link = $this->enableDir . '/' . $file; $link = $this->enableDir . '/' . $file;
if (! is_link($link)) { if (! is_link($link)) {
Logger::warn( Logger::warning(
'Found invalid module in enabledModule directory "%s": "%s" is not a symlink', 'Found invalid module in enabledModule directory "%s": "%s" is not a symlink',
$this->enableDir, $this->enableDir,
$link $link
@ -171,7 +171,7 @@ class Manager
$dir = realpath($link); $dir = realpath($link);
if (!file_exists($dir) || !is_dir($dir)) { if (!file_exists($dir) || !is_dir($dir)) {
Logger::warn( Logger::warning(
'Found invalid module in enabledModule directory "%s": "%s" points to non existing path "%s"', 'Found invalid module in enabledModule directory "%s": "%s" points to non existing path "%s"',
$this->enableDir, $this->enableDir,
$link, $link,
@ -517,7 +517,7 @@ class Manager
{ {
foreach ($this->modulePaths as $basedir) { foreach ($this->modulePaths as $basedir) {
if (!file_exists($basedir)) { if (!file_exists($basedir)) {
Logger::warn('Module path "%s" does not exist.', $basedir); Logger::warning('Module path "%s" does not exist.', $basedir);
continue; continue;
} }
$fh = opendir($basedir); $fh = opendir($basedir);
@ -532,7 +532,7 @@ class Manager
if (! array_key_exists($name, $this->installedBaseDirs)) { if (! array_key_exists($name, $this->installedBaseDirs)) {
$this->installedBaseDirs[$name] = $basedir . '/' . $name; $this->installedBaseDirs[$name] = $basedir . '/' . $name;
} else { } else {
Logger::warn( Logger::warning(
'Module "%s" already exists in installation path "%s" and is ignored.', 'Module "%s" already exists in installation path "%s" and is ignored.',
$basedir . '/' . $name, $basedir . '/' . $name,
$this->installedBaseDirs[$name] $this->installedBaseDirs[$name]

View File

@ -34,7 +34,7 @@ use Zend_Controller_Router_Route as Route;
use Icinga\Application\ApplicationBootstrap; use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Util\Translator; use Icinga\Util\Translator;
use Icinga\Web\Hook; use Icinga\Web\Hook;
@ -185,7 +185,7 @@ class Module
try { try {
$this->launchRunScript(); $this->launchRunScript();
} catch (Exception $e) { } catch (Exception $e) {
Logger::warn( Logger::warning(
'Launching the run script %s for module %s failed with the following exception: %s', 'Launching the run script %s for module %s failed with the following exception: %s',
$this->runScript, $this->runScript,
$this->name, $this->name,

View File

@ -37,7 +37,7 @@ use \Zend_View_Helper_PaginationControl;
use \Zend_Controller_Action_HelperBroker; use \Zend_Controller_Action_HelperBroker;
use \Zend_Controller_Router_Route; use \Zend_Controller_Router_Route;
use \Zend_Controller_Front; use \Zend_Controller_Front;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Authentication\Manager as AuthenticationManager; use Icinga\Authentication\Manager as AuthenticationManager;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Icinga\User\Preferences; use Icinga\User\Preferences;
@ -114,7 +114,8 @@ class Web extends ApplicationBootstrap
*/ */
protected function bootstrap() protected function bootstrap()
{ {
return $this->setupConfig() return $this->setupLogging()
->setupConfig()
->setupErrorHandling() ->setupErrorHandling()
->setupResourceFactory() ->setupResourceFactory()
->setupSession() ->setupSession()
@ -260,7 +261,7 @@ class Web extends ApplicationBootstrap
$path = Config::resolvePath($this->getConfig()->preferences->configPath); $path = Config::resolvePath($this->getConfig()->preferences->configPath);
if (is_dir($path) === false) { if (is_dir($path) === false) {
Logger::warn( Logger::warning(
'Path for preferences not found (IniStore, "%s"). Using default one: "%s"', 'Path for preferences not found (IniStore, "%s"). Using default one: "%s"',
$this->getConfig()->preferences->configPath, $this->getConfig()->preferences->configPath,
$this->getConfigDir('preferences') $this->getConfigDir('preferences')
@ -278,7 +279,7 @@ class Web extends ApplicationBootstrap
); );
$preferences->attach($preferenceStore); $preferences->attach($preferenceStore);
} catch (Exception $e) { } catch (Exception $e) {
Logger::warn( Logger::warning(
'Could not create create preferences provider, preferences will be discarded: ' 'Could not create create preferences provider, preferences will be discarded: '
. '"%s"', . '"%s"',
$e->getMessage() $e->getMessage()
@ -290,7 +291,7 @@ class Web extends ApplicationBootstrap
try { try {
$initialPreferences = $preferenceStore->load(); $initialPreferences = $preferenceStore->load();
} catch (Exception $e) { } catch (Exception $e) {
Logger::warn( Logger::warning(
'%s::%s: Could not load preferences from provider. ' '%s::%s: Could not load preferences from provider. '
. 'An exception during bootstrap was thrown: %s', . 'An exception during bootstrap was thrown: %s',
__CLASS__, __CLASS__,

View File

@ -39,7 +39,7 @@ use \Icinga\User;
use \Icinga\Authentication\UserBackend; use \Icinga\Authentication\UserBackend;
use \Icinga\Authentication\Credential; use \Icinga\Authentication\Credential;
use \Icinga\Authentication; use \Icinga\Authentication;
use \Icinga\Application\Logger; use \Icinga\Logger\Logger;
use \Icinga\Exception\ProgrammingError; use \Icinga\Exception\ProgrammingError;
use \Icinga\Exception\ConfigurationError; use \Icinga\Exception\ConfigurationError;

View File

@ -34,7 +34,7 @@ use \Zend_Config;
use Icinga\User; use Icinga\User;
use Icinga\Web\Session; use Icinga\Web\Session;
use Icinga\Data\ResourceFactory; use Icinga\Data\ResourceFactory;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
use Icinga\Application\Config as IcingaConfig; use Icinga\Application\Config as IcingaConfig;
use Icinga\Authentication\Backend\DbUserBackend; use Icinga\Authentication\Backend\DbUserBackend;
@ -168,7 +168,7 @@ class Manager
$name = $backendConfig->name; $name = $backendConfig->name;
// TODO: implement support for groups (#4624) and remove OR-Clause // TODO: implement support for groups (#4624) and remove OR-Clause
if ((!$target || strtolower($target) != "user") && !$backendConfig->class) { if ((!$target || strtolower($target) != "user") && !$backendConfig->class) {
Logger::warn('AuthManager: Backend "%s" has no target configuration. (e.g. target=user|group)', $name); Logger::warning('AuthManager: Backend "%s" has no target configuration. (e.g. target=user|group)', $name);
return null; return null;
} }
try { try {
@ -188,10 +188,10 @@ class Manager
case 'ldap': case 'ldap':
return new LdapUserBackend($backendConfig); return new LdapUserBackend($backendConfig);
default: default:
Logger::warn('AuthManager: Resource type ' . $backendConfig->type . ' not available.'); Logger::warning('AuthManager: Resource type ' . $backendConfig->type . ' not available.');
} }
} catch (Exception $e) { } catch (Exception $e) {
Logger::warn('AuthManager: Not able to create backend. Exception was thrown: %s', $e->getMessage()); Logger::warning('AuthManager: Not able to create backend. Exception was thrown: %s', $e->getMessage());
} }
return null; return null;
} }
@ -288,7 +288,6 @@ class Manager
} }
if ($authErrors >= count($this->userBackends)) { if ($authErrors >= count($this->userBackends)) {
Logger::fatal('AuthManager: No working backend found, unable to authenticate any user');
throw new ConfigurationError( throw new ConfigurationError(
'No working backend found. Unable to authenticate any user.' . 'No working backend found. Unable to authenticate any user.' .
"\nPlease examine the logs for more information." "\nPlease examine the logs for more information."

View File

@ -2,7 +2,7 @@
namespace Icinga\Data; namespace Icinga\Data;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Exception; use Icinga\Exception;
use Icinga\Filter\Filterable; use Icinga\Filter\Filterable;
use Icinga\Filter\Query\Node; use Icinga\Filter\Query\Node;

View File

@ -29,7 +29,7 @@
namespace Icinga\Protocol\Commandpipe\Transport; namespace Icinga\Protocol\Commandpipe\Transport;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
/** /**
* CommandPipe Transport class that writes to a file accessible by the filesystem * CommandPipe Transport class that writes to a file accessible by the filesystem

View File

@ -31,7 +31,7 @@ namespace Icinga\Protocol\Commandpipe\Transport;
use \RuntimeException; use \RuntimeException;
use \Zend_Config; use \Zend_Config;
use \Icinga\Application\Logger; use \Icinga\Logger\Logger;
/** /**
* Command pipe transport class that uses ssh for connecting to a remote filesystem with the icinga.cmd pipe * Command pipe transport class that uses ssh for connecting to a remote filesystem with the icinga.cmd pipe

View File

@ -31,7 +31,7 @@ namespace Icinga\Protocol\Ldap;
use Icinga\Application\Platform; use Icinga\Application\Platform;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Application\Logger as Log; use Icinga\Logger\Logger;
use \Zend_Config; use \Zend_Config;
/** /**
@ -273,14 +273,14 @@ class Connection
$r = @ldap_bind($ds, $username, $password); $r = @ldap_bind($ds, $username, $password);
if ($r) { if ($r) {
log::debug( Logger::debug(
'Successfully tested LDAP credentials (%s / %s)', 'Successfully tested LDAP credentials (%s / %s)',
$username, $username,
'***' '***'
); );
return true; return true;
} else { } else {
log::debug( Logger::debug(
'Testing LDAP credentials (%s / %s) failed: %s', 'Testing LDAP credentials (%s / %s) failed: %s',
$username, $username,
'***', '***',
@ -321,9 +321,9 @@ class Connection
if ($use_tls) { if ($use_tls) {
if ($cap->starttls) { if ($cap->starttls) {
if (@ldap_start_tls($ds)) { if (@ldap_start_tls($ds)) {
Log::debug('LDAP STARTTLS succeeded'); Logger::debug('LDAP STARTTLS succeeded');
} else { } else {
Log::debug('LDAP STARTTLS failed: %s', ldap_error($ds)); Logger::debug('LDAP STARTTLS failed: %s', ldap_error($ds));
throw new \Exception( throw new \Exception(
sprintf( sprintf(
'LDAP STARTTLS failed: %s', 'LDAP STARTTLS failed: %s',
@ -352,7 +352,7 @@ class Connection
// TODO: remove this -> FORCING v3 for now // TODO: remove this -> FORCING v3 for now
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
Log::warn('No LDAPv3 support detected'); Logger::warn('No LDAPv3 support detected');
} }
// Not setting this results in "Operations error" on AD when using the // Not setting this results in "Operations error" on AD when using the

View File

@ -29,7 +29,7 @@
namespace Icinga\Protocol\Statusdat; namespace Icinga\Protocol\Statusdat;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Data\DatasourceInterface; use Icinga\Data\DatasourceInterface;
use Icinga\Exception\ConfigurationError; use Icinga\Exception\ConfigurationError;
@ -147,7 +147,7 @@ class Reader implements IReader, DatasourceInterface
$maxCacheLifetime = intval($this->config->get('cache_path', self::DEFAULT_CACHE_LIFETIME)); $maxCacheLifetime = intval($this->config->get('cache_path', self::DEFAULT_CACHE_LIFETIME));
$cachingEnabled = true; $cachingEnabled = true;
if (!is_writeable($cachePath)) { if (!is_writeable($cachePath)) {
Logger::warn( Logger::warning(
'Can\'t cache Status.dat backend; make sure cachepath %s is writable by the web user. ' 'Can\'t cache Status.dat backend; make sure cachepath %s is writable by the web user. '
. 'Caching is now disabled', . 'Caching is now disabled',
$cachePath $cachePath

View File

@ -29,7 +29,7 @@
namespace Icinga\Session; namespace Icinga\Session;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use \Icinga\Exception\ConfigurationError; use \Icinga\Exception\ConfigurationError;
/** /**
@ -95,7 +95,7 @@ class PhpSession extends Session
foreach ($options as $sessionVar => $value) { foreach ($options as $sessionVar => $value) {
if (ini_set("session." . $sessionVar, $value) === false) { if (ini_set("session." . $sessionVar, $value) === false) {
Logger::warn( Logger::warning(
'Could not set php.ini setting %s = %s. This might affect your sessions behaviour.', 'Could not set php.ini setting %s = %s. This might affect your sessions behaviour.',
$sessionVar, $sessionVar,
$value $value

View File

@ -29,9 +29,8 @@
namespace Icinga\User\Preferences; namespace Icinga\User\Preferences;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Protocol\Ldap\Exception; use Icinga\Protocol\Ldap\Exception;
use \SplObserver;
use \SplSubject; use \SplSubject;
use \Icinga\User; use \Icinga\User;
use \Icinga\User\Preferences; use \Icinga\User\Preferences;

View File

@ -39,7 +39,7 @@ use Icinga\Application\Benchmark;
use Icinga\Util\Translator; use Icinga\Util\Translator;
use Icinga\Web\Widget\Tabs; use Icinga\Web\Widget\Tabs;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Web\Request; use Icinga\Web\Request;
use Icinga\File\Pdf; use Icinga\File\Pdf;

View File

@ -30,7 +30,7 @@
namespace Icinga\Web; namespace Icinga\Web;
use \stdClass; use \stdClass;
use \Icinga\Application\Logger as Log; use \Icinga\Logger\Logger;
use \Icinga\Exception\ProgrammingError; use \Icinga\Exception\ProgrammingError;
/** /**
@ -110,7 +110,7 @@ class Hook
$obj = new $class(); $obj = new $class();
} catch (\Exception $e) { } catch (\Exception $e) {
// TODO: Persist unloading for "some time" or "current session" // TODO: Persist unloading for "some time" or "current session"
Log::debug( Logger::debug(
'Hook "%s" (%s) failed, will be unloaded: %s', 'Hook "%s" (%s) failed, will be unloaded: %s',
$name, $name,
$class, $class,
@ -155,7 +155,7 @@ class Hook
try { try {
$instance = new $class(); $instance = new $class();
} catch (\Exception $e) { } catch (\Exception $e) {
Log::debug( Logger::debug(
'Hook "%s" (%s) (%s) failed, will be unloaded: %s', 'Hook "%s" (%s) (%s) failed, will be unloaded: %s',
$name, $name,
$key, $key,

View File

@ -31,7 +31,7 @@ namespace Icinga\Web;
use Icinga\Exception\ProgrammingError; use Icinga\Exception\ProgrammingError;
use Icinga\Application\Platform; use Icinga\Application\Platform;
use Icinga\Application\Logger as Log; use Icinga\Logger\Logger;
use Icinga\Web\Session; use Icinga\Web\Session;
/** /**
@ -90,13 +90,13 @@ class Notification
switch ($type) { switch ($type) {
case 'info': case 'info':
case 'success': case 'success':
Log::info($msg); Logger::info($msg);
break; break;
case 'warning': case 'warning':
Log::warn($msg); Logger::warn($msg);
break; break;
case 'error': case 'error':
Log::error($msg); Logger::error($msg);
break; break;
} }
return; return;

View File

@ -31,7 +31,7 @@ namespace Icinga\Web\Widget;
use \Icinga\Application\Icinga; use \Icinga\Application\Icinga;
use \Icinga\Application\Config as IcingaConfig; use \Icinga\Application\Config as IcingaConfig;
use \Icinga\Application\Logger; use \Icinga\Logger\Logger;
use \Icinga\Exception\ConfigurationError; use \Icinga\Exception\ConfigurationError;
use \Icinga\Web\Widget\Widget; use \Icinga\Web\Widget\Widget;
use \Icinga\Web\Widget\Dashboard\Pane; use \Icinga\Web\Widget\Dashboard\Pane;

View File

@ -29,7 +29,7 @@
namespace Icinga\Web\Widget\Tabextension; namespace Icinga\Web\Widget\Tabextension;
use \Icinga\Application\Logger; use \Icinga\Logger\Logger;
use \Icinga\Web\Widget\Tab; use \Icinga\Web\Widget\Tab;
use \Icinga\Web\Widget\Tabs; use \Icinga\Web\Widget\Tabs;
use \Icinga\Web\Url; use \Icinga\Web\Url;

View File

@ -29,7 +29,7 @@
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Controller\ActionController; use Icinga\Web\Controller\ActionController;
use Icinga\Chart\SVGRenderer; use Icinga\Chart\SVGRenderer;

View File

@ -30,7 +30,7 @@
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Module\Monitoring\DataView\HostStatus; use Icinga\Module\Monitoring\DataView\HostStatus;
use Icinga\Module\Monitoring\DataView\ServiceStatus; use Icinga\Module\Monitoring\DataView\ServiceStatus;
use Icinga\Module\Monitoring\Form\Command\DisableNotificationWithExpireForm; use Icinga\Module\Monitoring\Form\Command\DisableNotificationWithExpireForm;

View File

@ -29,7 +29,7 @@
namespace Icinga\Module\Monitoring\Backend\Ido\Query; namespace Icinga\Module\Monitoring\Backend\Ido\Query;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Data\Db\Query; use Icinga\Data\Db\Query;
use Icinga\Application\Benchmark; use Icinga\Application\Benchmark;
use Icinga\Exception\ProgrammingError; use Icinga\Exception\ProgrammingError;
@ -211,7 +211,7 @@ abstract class IdoQuery extends Query
} elseif ($this->hasAliasName($columnOrAlias)) { } elseif ($this->hasAliasName($columnOrAlias)) {
$columnOrAlias = $this->aliasToColumnName($columnOrAlias); $columnOrAlias = $this->aliasToColumnName($columnOrAlias);
} else { } else {
Logger::info('Can\'t order by column '.$columnOrAlias); Logger::info('Can\'t order by column ' . $columnOrAlias);
return $this; return $this;
} }
return parent::order($columnOrAlias, $dir); return parent::order($columnOrAlias, $dir);

View File

@ -29,7 +29,7 @@
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query; namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Data\Optional; use Icinga\Data\Optional;
use Icinga\Data\The; use Icinga\Data\The;
use Icinga\Filter\Query\Node; use Icinga\Filter\Query\Node;

View File

@ -30,7 +30,7 @@
namespace Icinga\Module\Monitoring\Filter; namespace Icinga\Module\Monitoring\Filter;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Logger; use Icinga\Logger\Logger;
use Icinga\Filter\Domain; use Icinga\Filter\Domain;
use Icinga\Filter\FilterAttribute; use Icinga\Filter\FilterAttribute;
use Icinga\Filter\Query\Node; use Icinga\Filter\Query\Node;

View File

@ -34,7 +34,6 @@ use Icinga\Filter\Query\Tree;
use Icinga\Filter\Query\Node; use Icinga\Filter\Query\Node;
use Icinga\Web\Request; use Icinga\Web\Request;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Application\Logger;
/** /**
* Converter class that allows to create Query Trees from an request query and vice versa * Converter class that allows to create Query Trees from an request query and vice versa