Constructs the logger hierarchy based on configuration.

@param \n2n\log4php\LoggerHierarchy $hierarchy
@param array $config
962753
private function doConfigure(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
		if (isset($config['threshold'])) {
			$threshold = \n2n\log4php\LoggerLevel::toLevel($config['threshold']);
			if (isset($threshold)) {
				$hierarchy->setThreshold($threshold);
			} else {
				$this->warn("Invalid threshold value [{$config['threshold']}] specified. Ignoring threshold definition.");
			}
		}
		
		// Configure appenders and add them to the appender pool
		if (isset($config['appenders']) && is_array($config['appenders'])) {
			foreach($config['appenders'] as $name => $appenderConfig) {
				$this->configureAppender($name, $appenderConfig);
			}
		}
		
		// Configure root logger 
		if (isset($config['rootLogger'])) {
			$this->configureRootLogger($hierarchy, $config['rootLogger']);
		}
		
		// Configure loggers
		if (isset($config['loggers']) && is_array($config['loggers'])) {
			foreach($config['loggers'] as $loggerName => $loggerConfig) {
				$this->configureOtherLogger($hierarchy, $loggerName, $loggerConfig);
			}
		}

		// Configure renderers
		if (isset($config['renderers']) && is_array($config['renderers'])) {
			foreach($config['renderers'] as $rendererConfig) {
				$this->configureRenderer($hierarchy, $rendererConfig);
			}
		}
		
		if (isset($config['defaultRenderer'])) {
			$this->configureDefaultRenderer($hierarchy, $config['defaultRenderer']);
		}
	}
539856
public function configure(Config $config)
    {
        $this->log_format    = $config->getString('log_format',self::DEFAULT_LOG_FORMAT);
        $this->log_encoding  = $config->getString('log_encoding','utf8');
        $this->log_levels    = $config->getList('log_levels',['T','D','I','W','E','F']);
    }
610631
private function configureLogger(array $mergedConfig, ContainerBuilder $container)
    {
        $this->configureLoggerFormatters($container);

        $loggerMiddleware = new Definition(LoggerMiddleware::class, [
            new Reference($mergedConfig['logger_formatter']),
            new Reference('logger')
        ]);
        $loggerMiddleware->setPublic(false);
        $loggerMiddleware->addTag('monolog.logger', ['channel' => 'command_bus']);

        $container->setDefinition('tactician.middleware.logger', $loggerMiddleware);
    }
921765
public function init( $config = NULL )
    {
        $this->config = $config;

        if ( isset( $config[ 'debug' ] ) )
        {
            $this->debug = $config[ 'debug' ];
        }

        $this->log = $this->filter( self::ON_SET_LOG_FILTER, NULL );

        $this->doAction( self::ON_COMPONENT_INIT_ACTION );
    }
711658
private function createAppender(LoggerHierarchy $hierarchy, $config)
    {
        if (isset($config['layout'])) {
            if (is_string($config['layout'])) {
                $config['layout'] = $hierarchy->getLayout($config['layout']);
            } elseif (is_array($config['layout'])) {
                $config['layout'] = $this->createLayout($config['layout']);
            } else {
                LoggerPolicy::processConfigurationError('Invalid logger layout description');
                unset($config['layout']);
            }
        }

        /** @noinspection PhpIncompatibleReturnTypeInspection */
        return $this->createObject($config);
    }
1339905
public void configureLogging(final LoggingSettings loggingSettings) {

        final Logger root = (Logger)LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
        final LoggerContext context = root.getLoggerContext();

        // Reset prior configuration
        context.reset();

        // Propagate level changes to java.util.logging
        final LevelChangePropagator propagator = new LevelChangePropagator();
        propagator.setContext(context);
        propagator.setResetJUL(true);

        // Set base threshold for all other loggers.
        root.setLevel(loggingSettings.getLevel());

        // Loop through explicitly configured loggers and set the levels
        for (final Map.Entry<String, Level> entry : loggingSettings.getLoggers().entrySet()) {
            ((Logger)LoggerFactory.getLogger(entry.getKey())).setLevel(entry.getValue());
        }

        if (loggingSettings.getLogFile().isEnabled()) {
            root.addAppender(getFileAppender(loggingSettings.getLogFile(), context));
        }

        if (loggingSettings.getConsole().isEnabled()) {
            root.addAppender(getConsoleAppender(loggingSettings.getConsole(), context));
        }
    }
253971
private function _createLogstash(array $formatterConfig)
    {
        if (false === array_key_exists('type', $formatterConfig)) {
            throw new MonologCreator\Exception(
                'type configuration for logstash foramtter is missing'
            );
        }

        return new Monolog\Formatter\LogstashFormatter(
            $formatterConfig['type'],
            null,
            null,
            'ctxt_',
            Monolog\Formatter\LogstashFormatter::V1
        );
    }
1157923
protected function createCommonHierarchy($collectionName, IMetadata $metadata, array $config)
    {
        if (!isset($config['class'])) {
            $config['class'] = $this->defaultCommonHierarchyClass;
        }

        return $this->getPrototype(
            $config['class'],
            ['umi\orm\collection\ICommonHierarchy']
        )
        ->createInstance([$collectionName, $metadata, $this->selectorFactory]);
    }
785455
public function setLogConfig(array $logConfig)
    {
        $this->logConfig = $logConfig;

        $this->hostConfig = array_merge($this->hostConfig, ['LogConfig' => $logConfig]);

        return $this;
    }
1094530
public function log($msg)
    {
        $agi = $this->getAgi();
        $this->logger->debug($msg);
        $agi->consoleLog($msg);
    }
508811
private function _log($level, $message)
    {
        $level_config = Config::get("log_level");
        if (!$level_config) {
            $level_config = "DEBUG";
        }

        $level_val = self::$levels[$level];
        $level_config = self::$levels[$level_config];

        if ($level_config > $level_val) {
            return ;
        }

        wlog($level, $message);
    }
211340
public function setConfig(Config $config)
    {
        parent::setConfig($config);

        foreach ($this->sequence as $command) {
            $command->setConfig($config);
        }

        return $this;
    }
903106
function findLoggerParent(logger) {
    if (rootLogger === logger) {
        return null;
    }
    var deep = true;

    var hierachy = getHierarchy(logger.name);
    var parent;
    for (var n = hierachy.length - 1; n >= 0 && !parent; n--) {
        parent = _.find(loggers, { name: hierachy[n] })
    }
    return parent || rootLogger;

}
107718
public static function log($msg, $logLevel = X_LOG_DEBUG) {
        /** @var Logger $logger */
        $logger = ComponentFactory::getComponent('logger');
        $logger->log($msg, $logLevel, 2);
    }
127689
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setTable('posts');
        $this->setDisplayField('title');
        $this->setPrimaryKey('id');

        $this->belongsTo('Categories', ['className' => 'MeCms.PostsCategories'])
            ->setForeignKey('category_id')
            ->setJoinType('INNER')
            ->setTarget($this->getTableLocator()->get('MeCms.PostsCategories'))
            ->setAlias('Categories');

        $this->belongsTo('Users', ['className' => 'MeCms.Users'])
            ->setForeignKey('user_id')
            ->setJoinType('INNER');

        $this->belongsToMany('Tags', ['className' => 'MeCms.Tags', 'joinTable' => 'posts_tags'])
            ->setForeignKey('post_id')
            ->setTargetForeignKey('tag_id')
            ->setThrough('MeCms.PostsTags');

        $this->addBehavior('Timestamp');
        $this->addBehavior('CounterCache', [
            'Categories' => ['post_count'],
            'Users' => ['post_count'],
        ]);

        $this->_validatorClass = PostValidator::class;
    }
124628
private function log($msg)
    {
        $logger = $this->getConfig('logger');
        if (!$logger) return false;
        return call_user_func_array($logger, array($msg));
    }
860298
protected function buildHandlers(array $config):array
    {
        $handlers = [];
        foreach ($config as $handler) {
            $level = constant('\Mostofreddy\Loggy\Logger::'. strtoupper($handler['level']));
            $handlerObj = '\Mostofreddy\Loggy\Handler\\'.ucfirst($handler['handler']);
            $handlers[] = (new $handlerObj($level))->config($handler);
        }
        return $handlers;
    }