Example #1
0
 /**
  * Show the asynchronous client logs in the main process logger (console)
  *
  * @return string|null
  *
  * @throws \RuntimeException
  */
 public static function subscribe()
 {
     if (!isset(self::$redisClient)) {
         throw new \RuntimeException('Redis client has not been initialised');
     }
     while (null != ($log = self::$redisClient->lpop(ConfigurationLoader::get('client.async.redis.key') . '.client.logs'))) {
         list($level, $message) = explode('|', $log);
         self::$logger->addRecord($level, $message);
     }
 }