diff options
Diffstat (limited to 'library/Director/Daemon/Logger.php')
-rw-r--r-- | library/Director/Daemon/Logger.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/library/Director/Daemon/Logger.php b/library/Director/Daemon/Logger.php new file mode 100644 index 0000000..27fcbf5 --- /dev/null +++ b/library/Director/Daemon/Logger.php @@ -0,0 +1,24 @@ +<?php + +namespace Icinga\Module\Director\Daemon; + +use Icinga\Application\Logger as IcingaLogger; +use Icinga\Application\Logger\LogWriter; +use Icinga\Exception\ConfigurationError; + +class Logger extends IcingaLogger +{ + public static function replaceRunningInstance(LogWriter $writer, $level = null) + { + try { + $instance = static::$instance; + if ($level !== null) { + $instance->setLevel($level); + } + + $instance->writer = $writer; + } catch (ConfigurationError $e) { + self::$instance->error($e->getMessage()); + } + } +} |