Static function to return an instance of a logger
@param   int   loggerType    - The logger type
@param   array loggerParams  - array of logger params

@return  self::$dbLink  - Returns static instance of mysqli connection

@public
@static
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);
        }
    }
230453
public function createLogger($channel)
    {
        if (!$this->app) {
            throw new \RuntimeException('No application instance provided.');
        }

        $logger = new Logger($channel);
        $level = $this->coreLevel;
        if (!in_array($channel, Channels::getCoreChannels())) {
            $level = Logger::DEBUG;
        }

        $handler = $this->createHandler($level);

        $logger->pushHandler($handler);
        $logger->pushProcessor($this->app->make(PsrLogMessageProcessor::class));
        $logger->pushProcessor($this->app->make(Concrete5UserProcessor::class));

        return $logger;
    }
976417
public function setLoggers(array $loggers)
    {
        $prevLogged = $this->loggedErrors;
        $prev = $this->loggers;
        $flush = [];

        foreach ($loggers as $type => $log) {
            if (!isset($prev[$type])) {
                throw new \InvalidArgumentException('Unknown error type: '.$type);
            }
            if (!\is_array($log)) {
                $log = [$log];
            } elseif (!\array_key_exists(0, $log)) {
                throw new \InvalidArgumentException('No logger provided');
            }
            if (null === $log[0]) {
                $this->loggedErrors &= ~$type;
            } elseif ($log[0] instanceof LoggerInterface) {
                $this->loggedErrors |= $type;
            } else {
                throw new \InvalidArgumentException('Invalid logger provided');
            }
            $this->loggers[$type] = $log + $prev[$type];

            if ($this->bootstrappingLogger && $prev[$type][0] === $this->bootstrappingLogger) {
                $flush[$type] = $type;
            }
        }
        $this->reRegister($prevLogged | $this->thrownErrors);

        if ($flush) {
            foreach ($this->bootstrappingLogger->cleanLogs() as $log) {
                $type = $log[2]['exception'] instanceof \ErrorException ? $log[2]['exception']->getSeverity() : E_ERROR;
                if (!isset($flush[$type])) {
                    $this->bootstrappingLogger->log($log[0], $log[1], $log[2]);
                } elseif ($this->loggers[$type][0]) {
                    $this->loggers[$type][0]->log($this->loggers[$type][1], $log[1], $log[2]);
                }
            }
        }

        return $prev;
    }
930873
public function getSimilarLogsQueryBuilder(Log $log)
    {
        return $this->createQueryBuilder()
                    ->select('l.id, l.channel, l.level, l.level_name, l.message, l.datetime')
                    ->from($this->tableName, 'l')
                    ->andWhere('l.message = :message')
                    ->andWhere('l.channel = :channel')
                    ->andWhere('l.level = :level')
                    ->andWhere('l.id != :id')
                    ->setParameter(':message', $log->getMessage())
                    ->setParameter(':channel', $log->getChannel())
                    ->setParameter(':level', $log->getLevel())
                    ->setParameter(':id', $log->getId());
    }
742356
public function execute($params = null)
    {
        if (is_array($params)) {
            $this->params = $params;
        }

        $logger = $this->conn->getConfiguration()->getSQLLogger();
        if ($logger) {
            $logger->startQuery($this->sql, $this->params, $this->types);
        }

        try {
            $stmt = $this->stmt->execute($params);
        } catch (Throwable $ex) {
            if ($logger) {
                $logger->stopQuery();
            }
            throw DBALException::driverExceptionDuringQuery(
                $this->conn->getDriver(),
                $ex,
                $this->sql,
                $this->conn->resolveParams($this->params, $this->types)
            );
        }

        if ($logger) {
            $logger->stopQuery();
        }
        $this->params = [];
        $this->types  = [];

        return $stmt;
    }
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;
    }
795591
private static function _getLoggerLevel3($loggerParams) {
        if (!isset(self::$loggerLevel3)) {          
            /*create notifier object for africas talking. If you are behind a proxy, the
             *second parameter should be true, and your configuration array should contain
             *the proxy server settings
             */
            $notifierObj = new NotifierSmsAfricasTalkingService($loggerParams['notifier_params'], true);
            $recipientList = $loggerParams['notifier_recipients'];

            $CymapgtLevel3LogDir = $loggerParams['log_dir'];
            $CymapgtLevel3Stream = new StreamHandler($CymapgtLevel3LogDir, MonologLogger::ERROR);
            $CymapgtLevel3Logger = new MonologLogger('cymapgt_level3');
            $CymapgtLevel3Mailer  = new \Swift_Mailer($loggerParams['swiftmailer_transport']);
            $CymapgtLevel3Message = $loggerParams['swiftmailer_message'];        
            $CymapgtLevel3Logger->pushHandler($CymapgtLevel3Stream);
            $CymapgtLevel3Logger->pushHandler(new SwiftMailerHandler($CymapgtLevel3Mailer, $CymapgtLevel3Message));
            $smsHandler = new NotifierSmsAfricasTalkingServiceHandler($notifierObj);
            $smsHandler->setRecipients($recipientList);
            $CymapgtLevel3Logger->pushHandler($smsHandler);
            self::$loggerLevel3 = $CymapgtLevel3Logger;
        }
        return self::$loggerLevel3;
    }
844697
public function hasLogger($loggerType)
    {
        try {
            $this->getContainer()->getNamingDirectory()->search(sprintf('php:global/log/%s', $loggerType));
            return true;
        } catch (NamingException $ne) {
            return false;
        }
    }
1022828
function createEventLogger( event_type, db_connection, custom_logger ) {
  var logger = custom_logger || console;

  if ( !messages[ event_type ] ) {
    throw new Error(
      'message type [ %type ] not supported'
        .replace( '%type', event_type )
    )
  }

  /**
   * @returns {undefined}
   */
  function logEvent() {
    if ( event_type === 'error' ) {
      logger.error(
        messages[ event_type ]
          .replace( '%date', new Date() )
          .replace( '%host', db_connection.host )
          .replace( '%port', db_connection.port )
          .replace( '%database', db_connection.name )
      )

      return
    }

    logger.log(
      messages[ event_type ]
        .replace( '%date', new Date() )
        .replace( '%host', db_connection.host )
        .replace( '%port', db_connection.port )
        .replace( '%database', db_connection.name )
    )
  }

  return logEvent
}
1025965
public function generate($entity,$type = self::TYPE_LINK_DEFAULT,$parameters = array())
    {
        if($type === null){
            $type = self::TYPE_LINK_DEFAULT;
        }
        $entityConfig = $this->getEntityConf($entity);
        $link = '';
        if($entityConfig){
            $link = $this->generateFromConfig($entity,$entityConfig,$type,$parameters);
        }
        return $link;
    }
417327
public function logger($logger = null)
    {
        if ($logger) {
            $this->_logger = $logger;
        }

        if ($this->_logger) {
            return $this->_logger;
        }

        $this->_logger = new QueryLogger();
        return $this->_logger;
    }
178123
function GetSqliteType()
	{
		$rt = $this->Type;
		switch ($this->Type)
		{
			case "int":
				$rt = "integer";
				break;
			case "smallint":
				$rt = "integer";
				break;
			case "tinyint":
				$rt = "integer";
				break;
			case "varchar":
				$rt = "text";
				break;
			case "text":
				$rt = "text";
				break;
			case "tinytext":
				$rt = "text";
				break;
			case "date":
				$rt = "datetime";
				break;
			case "datetime":
				$rt = "datetime";
				break;
			case "mediumint":
				$rt = "integer";
				break;
			case "bigint":
				$rt = "integer";
				break;
			case "decimal":
				$rt = "real";
				break;
			case "float":
				$rt = "real";
				break;
			default;
				break;
		}

		return $rt;
	}
1173074
protected function getSQLLogger()
    {
        if (!$this->SQLLogger instanceof SQLLogger) {
            $sqlLogger = $this->getOption('sql_logger');

            if ($sqlLogger instanceof SQLLogger) {
                $this->SQLLogger = $sqlLogger;
            }
        }

        return $this->SQLLogger;
    }
346984
public function getLogger()
    {
        if (is_null($this->logger)) {
            $this->logger = oxNew(\OxidEsales\PayPalModule\Core\Logger::class);
            $this->logger->setLoggerSessionId($this->getSession()->getId());
        }

        return $this->logger;
    }
328998
protected function buildQueryCallback(LogManager $logger): callable
    {
        return function (QueryExecuted $query) use ($logger) {
            $sql = Str::replaceArray('?', $query->connection->prepareBindings($query->bindings), $query->sql);

            $logger->info("<comment>{$sql} [{$query->time}ms]</comment>");
        };
    }
1267251
public static function getOrCreateFileLogger(string $category, string $logfilePath): LoggerInterface
    {
        $hash = sha1($category . $logfilePath);

        if (!isset(self::$instance[$hash])) {
            $logger = new Logger($category);
            $logger->pushHandler(new StreamHandler($logfilePath, Logger::DEBUG));

            self::$instance[$hash] = $logger;
        }

        return self::$instance[$hash];
    }
641581
private function db_log(
			&$type,
			&$message,
			&$log_order,
			&$caller
		) {
			global $wpdb;

			$request_type = 'call';
			if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
				$request_type = 'cron';
			} else if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
				$request_type = 'ajax';
			}

			$request_url = WP_FS__IS_HTTP_REQUEST ?
				$_SERVER['REQUEST_URI'] :
				'';

			return $wpdb->insert(
				"{$wpdb->prefix}fs_logger",
				array(
					'process_id'   => self::$_processID,
					'user_name'    => self::$_ownerName,
					'logger'       => $this->_id,
					'log_order'    => $log_order,
					'type'         => $type,
					'request_type' => $request_type,
					'request_url'  => $request_url,
					'message'      => $message,
					'file'         => isset( $caller['file'] ) ?
						substr( $caller['file'], self::$_abspathLength ) :
						'',
					'line'         => $caller['line'],
					'function'     => ( ! empty( $caller['class'] ) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
					'created'      => microtime( true ),
				)
			);
		}