docs: function(f) {
      this.socket = tls.connect(this.config.tcp, f);
  
      this.socket.on('secureConnect', function() {
        this.isConnected = true;
        if (this.retryCount > 1) {
          this.logger.info('Logmatic - reconnected.');
        } else {
          this.logger.debug('Logmatic - connected.');
        }
        this.retryCount = 0;
  
        while (this.messageBuffer.length) {
          this.sendMessage(this.messageBuffer.shift());
        }
      }.bind(this));
  
      this.socket.on('timeout', function() {
        this.logger.warn('Logmatic - connection timed out.');
      });
  
      this.socket.on('error', this.logger.error.bind(this.logger));
  
      this.socket.on('close', function() {
        this.isConnected = false;
        this.retryCount++;
  
        if(this.retryCount > 1) {
          setTimeout(function() {
            this.connect();
          }.bind(this), this.config.retryTimeout);
          this.logger.error('Logmatic - failling to reconnect', this.retryCount);
        } else {
          this.connect();
          this.logger.debug('Logmatic - connection closed.');
        }
      }.bind(this));
    }