logstash/tcp-bunyan.js
function LogstashStream(options) {
  EventEmitter.call(this);
  options = options || {};

  this.name = 'bunyan';
  this.level = options.level || 'info';
  this.server = options.server || os.hostname();
  this.host = options.host || '127.0.0.1';
  this.port = options.port || 9999;
  this.application = options.appName || process.title;
  this.pid = options.pid || process.pid;
  this.tags = options.tags || ['bunyan'];
  this.type = options.type;

  this.client = null;

  // ssl
  this.ssl_enable = options.ssl_enable || false;
  this.ssl_key = options.ssl_key || '';
  this.ssl_cert = options.ssl_cert || '';
  this.ca = options.ca || '';
  this.ssl_passphrase = options.ssl_passphrase || '';

  this.cbuffer_size = options.cbuffer_size || 10;

  // Connection state
  this.log_queue = new CBuffer(this.cbuffer_size);
  this.connected = false;
  this.socket = null;
  this.retries = -1;

  this.max_connect_retries = (typeof options.max_connect_retries === 'number') ? options.max_connect_retries : 4;
  this.retry_interval = options.retry_interval || 100;

  this.connect();
}
function LogstashStream(options) {
  EventEmitter.call(this);
  options = options || {};

  this.name = 'bunyan';
  this.level = options.level || 'info';
  this.server = options.server || os.hostname();
  this.host = options.host || '127.0.0.1';
  this.port = options.port || 9999;
  this.application = options.appName || process.title;
  this.pid = options.pid || process.pid;
  this.tags = options.tags || ['bunyan'];
  this.type = options.type;

  this.client = null;

  // ssl
  this.ssl_enable = options.ssl_enable || false;
  this.ssl_key = options.ssl_key || '';
  this.ssl_cert = options.ssl_cert || '';
  this.ca = options.ca || '';
  this.ssl_passphrase = options.ssl_passphrase || '';

  this.cbuffer_size = options.cbuffer_size || 10;

  // Connection state
  this.log_queue = new CBuffer(this.cbuffer_size);
  this.connected = false;
  this.socket = null;
  this.retries = -1;

  this.max_connect_retries = (typeof options.max_connect_retries === 'number') ? options.max_connect_retries : 4;
  this.retry_interval = options.retry_interval || 100;

  this.connect();
}
function LogstashStream ( options ) { EventEmitter . call ( this ) ; options = options || { } ; this . name = 'bunyan' ; this . level = options . level || 'info' ; this . server = options . server || os . hostname ( ) ; this . host = options . host || '127.0.0.1' ; this . port = options . port || 9999 ; this . application = options . appName || process . title ; this . pid = options . pid || process . pid ; this . tags = options . tags || [ 'bunyan' ] ; this . type = options . type ; this . client = null ; // ssl
 this . ssl_enable = options . ssl_enable || false ; this . ssl_key = options . ssl_key || '' ; this . ssl_cert = options . ssl_cert || '' ; this . ca = options . ca || '' ; this . ssl_passphrase = options . ssl_passphrase || '' ; this . cbuffer_size = options . cbuffer_size || 10 ; // Connection state
 this . log_queue = new CBuffer ( this . cbuffer_size ) ; this . connected = false ; this . socket = null ; this . retries = - 1 ; this . max_connect_retries = ( typeof options . max_connect_retries === 'number' ) ? options . max_connect_retries : 4 ; this . retry_interval = options . retry_interval || 100 ; this . connect ( ) ; }
This class implements the bunyan stream contract with a stream that
sends data to logstash.

@param {objects} options The constructions options. See the constructor for details.
TODO: Improve this doc.

@constructor
This class implements the bunyan stream contract with a stream that sends data to logstash .