How to use the bunyan function in bunyan

To help you get started, we’ve selected a few bunyan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat / app / ldap / server / ldap.js View on Github external
connectAsync(callback) {
		logger.connection.info('Init setup');

		let replied = false;

		const connectionOptions = {
			url: `${ this.options.host }:${ this.options.port }`,
			timeout: this.options.timeout,
			connectTimeout: this.options.connect_timeout,
			idleTimeout: this.options.idle_timeout,
			reconnect: this.options.Reconnect,
		};

		if (this.options.Internal_Log_Level !== 'disabled') {
			connectionOptions.log = new Bunyan({
				name: 'ldapjs',
				component: 'client',
				stream: process.stderr,
				level: this.options.Internal_Log_Level,
			});
		}

		const tlsOptions = {
			rejectUnauthorized: this.options.reject_unauthorized,
		};

		if (this.options.ca_cert && this.options.ca_cert !== '') {
			// Split CA cert into array of strings
			const chainLines = settings.get('LDAP_CA_Cert').split('\n');
			let cert = [];
			const ca = [];
github wekan / wekan / packages / wekan-ldap / server / ldap.js View on Github external
connectAsync(callback) {
    log_info('Init setup');

    let replied = false;

    const connectionOptions = {
      url           : `${this.options.host}:${this.options.port}`,
      timeout       : this.options.timeout,
      connectTimeout: this.options.connect_timeout,
      idleTimeout   : this.options.idle_timeout,
      reconnect     : this.options.Reconnect,
    };

    if (this.options.Internal_Log_Level !== 'disabled') {
      connectionOptions.log = new Bunyan({
        name     : 'ldapjs',
        component: 'client',
        stream   : process.stderr,
        level    : this.options.Internal_Log_Level,
      });
    }

    const tlsOptions = {
      rejectUnauthorized: this.options.reject_unauthorized,
    };

    if (this.options.ca_cert && this.options.ca_cert !== '') {
      // Split CA cert into array of strings
      const chainLines = this.constructor.settings_get('LDAP_CA_CERT').split('\n');
      let cert         = [];
      const ca         = [];
github RocketChat / Rocket.Chat / packages / rocketchat-ldap / server / ldap.js View on Github external
connectAsync(callback) {
		logger.connection.info('Init setup');

		let replied = false;

		const connectionOptions = {
			url: `${ this.options.host }:${ this.options.port }`,
			timeout: this.options.timeout,
			connectTimeout: this.options.connect_timeout,
			idleTimeout: this.options.idle_timeout,
			reconnect: this.options.Reconnect
		};

		if (this.options.Internal_Log_Level !== 'disabled') {
			connectionOptions.log = new Bunyan({
				name: 'ldapjs',
				component: 'client',
				stream: process.stderr,
				level: this.options.Internal_Log_Level
			});
		}

		const tlsOptions = {
			rejectUnauthorized: this.options.reject_unauthorized
		};

		if (this.options.ca_cert && this.options.ca_cert !== '') {
			// Split CA cert into array of strings
			const chainLines = RocketChat.settings.get('LDAP_CA_Cert').split('\n');
			let cert = [];
			const ca = [];
github probot / probot / src / logger.ts View on Github external
function toBunyanFormat (format: string) {
  switch (format) {
    case 'short':
    case 'long':
    case 'simple':
    case 'json':
    case 'bunyan':
    case undefined:
      return format
    default:
      throw new Error('Invalid log format')
  }
}

export const logger = new Logger({
  level: toBunyanLogLevel(process.env.LOG_LEVEL || 'info'),
  name: 'probot',
  serializers,
  stream: new bunyanFormat({
    color: supportsColor.stdout,
    levelInString: !!process.env.LOG_LEVEL_IN_STRING,
    outputMode: toBunyanFormat(process.env.LOG_FORMAT || 'short')
  })
})