code: def emit(self, record):
          
          try:
              if self.max_messages:
                  p = self.redis_client.pipeline()
                  p.rpush(self.key, self.format(record))
                  p.ltrim(self.key, -self.max_messages, -1)
                  p.execute()
              else:
                  self.redis_client.rpush(self.key, self.format(record))
          except redis.RedisError:
              pass
docs: Publish record to redis logging list