return the level2 logger

@param  array  $loggerParams - Array of parameters to configure the level 2 logger

@return object
@private
@static
964715
private static function _getLoggerLevel2($loggerParams) {
        if (!isset(self::$loggerLevel2)) {        
            $CymapgtLevel2LogDir = $loggerParams['log_dir'];
            $CymapgtLevel2Stream = new StreamHandler($CymapgtLevel2LogDir, MonologLogger::ERROR);
            $CymapgtLevel2Logger = new MonologLogger('cymapgt_level2');
            $CymapgtLevel2Mailer  = new \Swift_Mailer($loggerParams['swiftmailer_transport']);
            $CymapgtLevel2Message = $loggerParams['swiftmailer_message'];
            $CymapgtLevel2Logger->pushHandler($CymapgtLevel2Stream);
            $CymapgtLevel2Logger->pushHandler(new SwiftMailerHandler($CymapgtLevel2Mailer, $CymapgtLevel2Message));
            self::$loggerLevel2 = $CymapgtLevel2Logger;
        }
        return self::$loggerLevel2;
    }
906669
public function getOAuthProvider($params)
    {
        if (is_string($params)) {
            $params = array('provider_consumer_key' => $params);
        } else {
            $params = $this->checkFilterParams($params, array('provider_consumer_key'), array('provider_consumer_key'));
            if ($params === false) {
                throw new \InvalidArgumentException("params array contains invalid parameters or misses required parameters");
            }
        }

        return $this->lastRequest->get(null, 'oauth_providers/' . $params[ 'provider_consumer_key' ]);
    }
1191617
public static function getLogLevel($class = '') {
        if (!is_string($class)) throw new IllegalTypeException('Illegal type of parameter $class: '.gettype($class));
        self::init();

        // read the configured class specific loglevels
        static $logLevels = null;
        if ($logLevels === null) {
            /** @var ConfigInterface $config */
            $config = self::di('config');

            $logLevels = $config->get('log.level', []);
            if (is_string($logLevels))
                $logLevels = ['' => $logLevels];                            // only the general application loglevel is configured

            foreach ($logLevels as $className => $level) {
                if (!is_string($level)) throw new IllegalTypeException('Illegal configuration value for "log.level.'.$className.'": '.gettype($level));

                if ($level == '') {                                         // classes with empty values fall back to the application loglevel
                    unset($logLevels[$className]);
                }
                else {
                    $logLevel = self::logLevelToId($level);
                    if (!$logLevel) throw new InvalidArgumentException('Invalid configuration value for "log.level.'.$className.'" = '.$level);
                    $logLevels[$className] = $logLevel;

                    if (strStartsWith($className, '\\')) {                  // normalize class names: remove leading back slash
                        unset($logLevels[$className]);
                        $className = substr($className, 1);
                        $logLevels[$className] = $logLevel;
                    }
                }
            }
            $logLevels = \array_change_key_case($logLevels, CASE_LOWER);    // normalize class names: lower-case for case-insensitive look-up
        }

        // look-up the loglevel for the specified class
        $class = strtolower($class);
        if (isset($logLevels[$class]))
            return $logLevels[$class];

        // return the general application loglevel if no class specific loglevel is configured
        return self::$appLogLevel;
    }
1278634
protected function format(\n2n\log4php\logging\LoggingEvent $event) {
		$params = array();
		foreach($this->converters as $converter) {
			$buffer = '';
			while ($converter !== null) {
				$converter->format($buffer, $event);
				$converter = $converter->next;
			}
			$params[] = $buffer;
		}
		return $params;
	}
1177485
protected function getLogLevel($logLevel)
    {
        switch ($logLevel) {
            case Logger::DEBUG:
                return Severity::debug();
            case Logger::INFO:
                return Severity::info();
            case Logger::NOTICE:
                return Severity::info();
            case Logger::WARNING:
                return Severity::warning();
            case Logger::ERROR:
                return Severity::error();
            case Logger::CRITICAL:
                return Severity::fatal();
            case Logger::ALERT:
                return Severity::fatal();
            case Logger::EMERGENCY:
                return Severity::fatal();

        }
    }
483908
public function findOneByParams(array $params = [])
    {
        $params['limit'] = 1;
        $records = $this->findByParams($params);
        if (count($records) > 0) {
            return $records->rewind();
        }

        return null;
    }
446079
public function getPsrLog(): ?LoggerInterface
    {
        if (!$this->hasPsrLog()) {
            $this->setPsrLog($this->getDefaultPsrLog());
        }
        return $this->psrLog;
    }
1286531
public static function getLogger()
    {
        if (self::$logger === null)
        {
            try
            {
                $result = Hook::execute(
                    "Wedeto.Util.GetLogger", 
                    ["logger" => null, "class" => static::class]
                );
            }
            catch (RecursionException $e)
            {
                // Apparently the hook is calling getLogger which is failing, so
                // use an emergency logger to log anyway.
                $result = ['logger' => new EmergencyLogger];
            }

            self::$logger = $result['logger'] ?? new NullLogger();
        }
        return self::$logger;
    }
284580
protected function getLogger()
    {
        if (!isset($this->loggerClasses[$this->type])) {
            throw new OutOfBoundsException($this->translate(
                'Logger type "{type}" does not exist.',
                ['type' => $this->type]
            ));
        }

        $prototype = $this->getPrototype($this->loggerClasses[$this->type], ['umi\log\ILogger']);

        return $prototype->createSingleInstance(
            [$this->options],
            [],
            function(ILogger $logger)
            {
                $logger
                    ->setMinLevel($this->minLevel)
                    ->setMessageFormat($this->messageFormat);
            }
        );
    }
354583
public static function getLogger($loggerType, $loggerParams = array()) {
        //trap all possible exceptions and throw LoggerException
        try {
            switch ($loggerType) {
                case LOGGER_STDERR:
                    return self::_getLoggerStderr();
                case LOGGER_LEVEL1:
                    return self::_getLoggerLevel1($loggerParams);
                case LOGGER_LEVEL2:
                    return self::_getLoggerLevel2($loggerParams);                
                case LOGGER_LEVEL3:
                    return self::_getLoggerLevel3($loggerParams);              
                case LOGGER_SECURITY:
                    return self::_getLoggerSecurity($loggerParams);
            }            
        } catch (\Exception $logException) {
            throw new LoggerException('Logger caught an exception in '
                . $logException->getTraceAsString() . ':'
                . $logException->getMessage(), 1001);
        }
    }
1216691
protected function level(array $config)
    {
        $level = $config['level'] ?? 'debug';

        if (isset($this->levels[$level])) {
            return $this->levels[$level];
        }

        throw new \InvalidArgumentException('Invalid log level.');
    }
543966
protected static function getLoggerId(\Plop\LoggerInterface $logger)
    {
        $func   = $logger->getMethod();
        $cls    = $logger->getClass();
        $ns     = $logger->getNamespace();
        return "$func:$cls:$ns";
    }
1081130
public static function getInstance($loggerName = __CLASS__)
    {
        if (array_key_exists($loggerName, LoggingManager::$instances)) {
            return LoggingManager::$instances[$loggerName];
        }
        $instance = new self($loggerName);
        LoggingManager::$instances[$loggerName] = $instance;
        return $instance;
    }
27963
public function getById($logId, array $queryParams = [])
    {
        $response = $this->api->logs()->getById($logId, $queryParams);

        return new LogResponse($response);
    }
1017747
public function get($params = null) {
		$this->buffer = $this->getConfigs();

		if (isset($params)) {
			$params = trim($params);
			$params_list = explode('/', $params);
			$params_count = count($params_list);

			for ($i=0; $i<$params_count; $i++) {
				if ($i == $params_count) { return $this->buffer[$params_list[$i]]; }

				$this->buffer = $this->buffer[$params_list[$i]];
			}
		}

		return $this->buffer;
	}
154201
private static function _getLoggerStderr() {
        if (!isset(self::$loggerStderr)) {        
            $CymapgtStderrLogger = new MonologLogger('cymapgt_stderr');
            $CymapgtStderrLogger->pushHandler(new ErrorLogHandler());
            self::$loggerStderr = $CymapgtStderrLogger;
        }
        return self::$loggerStderr;
    }
1043424
public static function create(array $options = [], $logger = Client::LOG_NONE)
    {
        $oauth = new Oauth1([
            'token_secret' => '',
            'consumer_key' => $options['consumerKey'],
            'consumer_secret' => $options['consumerSecret']
        ]);

        $stack = HandlerStack::create();
        $stack->push($oauth);

        if (!empty($logger)) {
            $stack->push(
                Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG))
            );
        }

        $client = new \GuzzleHttp\Client([
            'base_uri' => self::$url,
            'handler' => $stack,
            'auth' => 'oauth'
        ]);

        $mapper = new ResultObjectMapper();

        return new self(
            new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)),
            new Validator(Validation::createValidator()),
            $mapper
        );
    }