public function setBackend(Backend\BackendInterface $backend)
    {
        if ($this->psrCompatibleLoggerWasInjected) {
            throw new Exception('A PSR-3 logger was injected so setting backends is not possible. Create a new instance.', 1515342951935);
        }

        foreach ($this->backends as $backend) {
            $backend->close();
        }
        $this->backends = new \SplObjectStorage();
        $this->backends->attach($backend);
    }