/** * Reset all values contained in this hierarchy instance to their * default. * * This removes all appenders from all loggers, sets * the level of all non-root loggers to <i>null</i>, * sets their additivity flag to <i>true</i> and sets the level * of the root logger to {@link LOGGER_LEVEL_DEBUG}. * * <p>Existing loggers are not removed. They are just reset. * * <p>This method should be used sparingly and with care as it will * block all logging until it is completed.</p> */ public function resetConfiguration() { $root = $this->getRootLogger(); $root->setLevel(LoggerLevel::getLevelDebug()); $this->setThreshold(LoggerLevel::getLevelAll()); $this->shutDown(); foreach ($this->loggers as $logger) { $logger->setLevel(null); $logger->setAdditivity(true); $logger->removeAllAppenders(); } $this->rendererMap->reset(); LoggerAppenderPool::clear(); }
/** * Reset all values contained in this hierarchy instance to their * default. * * This removes all appenders From all categories, sets * the level of all non-root categories to <i>null</i>, * sets their additivity flag to <i>true</i> and sets the level * of the root logger to {@link LOGGER_LEVEL_DEBUG}. Moreover, * message disabling is set its default "off" value. * * <p>Existing categories are not removed. They are just reset. * * <p>This method should be used sparingly and with care as it will * block all logging until it is completed.</p> */ public function resetConfiguration() { $root = $this->getRootLogger(); $root->setLevel(LoggerLevel::getLevelDebug()); $this->setThreshold(LoggerLevel::getLevelAll()); $this->shutDown(); $loggers = $this->getCurrentLoggers(); $enumLoggers = count($loggers); for ($i = 0; $i < $enumLoggers; $i++) { $loggers[$i]->setLevel(null); $loggers[$i]->setAdditivity(true); $loggers[$i]->removeAllAppenders(); } $this->rendererMap->clear(); LoggerAppenderPool::clear(); }