I would mean more like this (which allows testability):

```
public function __construct($dsn, $persistId = 'monolog', $type = ZMQ::SOCKET_PUSH, $context = null, $level = Logger::DEBUG, $bubble = true)
{
    $this->dsn = $dsn;
    $this->persistId = $persistId;
    $this->type = $type;
    $this->context = $context;

    parent::__construct($level, $bubble);
}

/**
 * {@inheritDoc}
 */
protected function write(array $record)
{
    if (null === $this->context) {
        $this->context = new ZMQContext(1, true);
    }
    if (null === $this->socket) {
        $this->socket = $this->context->getSocket($this->type, $this->persistId);
        $this->socket->connect($this->dsn);
    }

    $this->socket->send($record['formatted'], ZMQ::MODE_NOBLOCK);
}
```