Add standard Client logger streams to `config.streams`
@private
@param  {Object} config
@param  {Array?} config.streams
@returns {Array}
552348
function getStreams(config) {
  // Any passed in streams
  const streams = Array.isArray(config.streams)
    ? [...config.streams]
    : [];

  // Nice console output
  if (config.stdout) {
    streams.push({
      name: 'stdout',
      level: config.level,
      stream: new ClientConsoleLogger(),
      type: 'raw',
    });
  }

  // Rollbar Transport
  // Messages at the warn level or higher are transported to Rollbar
  // Detects presence of global Rollbar and passed in token
  if (isGlobalRollbarConfigured()) {
    if (config.rollbarToken) {
      streams.push({
        name: 'rollbar',
        level: 'warn',
        stream: new ClientRollbarLogger({
          token: config.rollbarToken,
          environment: config.environment,
          codeVersion: config.codeVersion,
        }),
        type: 'raw',
      });
    }
  } else {
    /* eslint-disable no-console */
    console.warn('Client rollbar is not correctly configured');
    /* eslint-enable */
  }

  // Transport client logs
  if (config.logentriesToken) {
    streams.push({
      name: 'logentries',
      level: config.level,
      stream: new ClientLogentriesLogger({
        name: config.name,
        token: config.logentriesToken,
      }),
      type: 'raw',
    });
  }

  return streams;
}
702918
function containerLogs(container) {

  // create a single stream for stdin and stdout
  var logStream = new stream.PassThrough();
  logStream.on('data', function(chunk){
    console.log(chunk.toString('utf8'));
  });

  container.logs({
    follow: true,
    stdout: true,
    stderr: true
  }, function(err, stream){
    if(err) {
      return logger.error(err.message);
    }
    container.modem.demuxStream(stream, logStream, logStream);
    stream.on('end', function(){
      logStream.end('!stop!');
    });

    setTimeout(function() {
      stream.destroy();
    }, 2000);
  });
}
1167818
function (config) {
    config = config || {};
    Appender.call(this, config);

    /**
     * Log file name, initialized from the configuration. Folders up to the
     * file must exist beforehand.
     * fileName is really the _base_ file name. The real file names will be
     * prepended by a timestamp.
     */
    this.fileName = config.fileName;

    /**
     * The policy used to determine when we should roll the log file. It can be 
     * either time based (roll every x mins), size based (roll when the size
     * of the file is more than x bytes), or both (the first one happening).
     * { time: <timeInMinutes>, size: <sizeInBytes> }
     */
    this.triggeringPolicy = config.triggeringPolicy;

    /**
     * True to log strings instead of objects
     */
    this.appendStrings = (typeof config.appendStrings !== 'undefined') ?
      config.appendStrings :
      true;

    /**
     * The file stream, initialized by the "start" function
     */
    this.stream = null;
  }
1264442
function loggerFactory(
    events,
    Constants,
    assert,
    _,
    util,
    stack,
    nconf
) {
    var levels = _.keys(Constants.Logging.Levels);

    function getCaller (depth) {
        var current = stack.get()[depth];

        var file = current.getFileName().replace(
            Constants.WorkingDirectory,
            ''
        ) + ':' + current.getLineNumber();

        return file.replace(/^node_modules/, '');
    }

    function Logger (module) {
        var provides = util.provides(module);

        if (provides !== undefined) {
            this.module = provides;
        } else {
            if (_.isFunction(module)) {
                this.module = module.name;
            } else {
                this.module = module || 'No Module';
            }
        }
    }

    Logger.prototype.log = function (level, message, context) {
        assert.isIn(level, levels);
        assert.string(message, 'message');

        // Exit if the log level of this message is less than the minimum log level.
        var minLogLevel = nconf.get('minLogLevel');
        if ((minLogLevel === undefined) || (typeof minLogLevel !== 'number')) {
            minLogLevel = 0;
        }
        if (Constants.Logging.Levels[level] < minLogLevel) {
            return;
        }

        events.log({
            name: Constants.Name,
            host: Constants.Host,
            module: this.module,
            level: level,
            message: message,
            context: context,
            timestamp: new Date().toISOString(),
            caller: getCaller(3),
            subject: 'Server'
        });
    };

    _.forEach(levels, function(level) {
        Logger.prototype[level] = function (message, context) {
            this.log(level, message, context);
        };
    });

    Logger.prototype.deprecate = function (message, frames) {
        console.error([
            'DEPRECATION:',
            this.module,
            '-',
            message,
            getCaller(frames || 2)
        ].join(' '));
    };

    Logger.initialize = function (module) {
        return new Logger(module);
    };

    return Logger;
}
934693
function configure(config) {
    var key,
        layout = null,
        fields = {},
        options = {
            port: (typeof config.port === "number") ? config.port : 5959,
            host: (typeof config.host === "string") ? config.host : 'localhost',
            debug: config.debug || false
        };

    if (config.batch) {
        options.batch = true;
        options.batchSize = config.batch.size;
        options.batchTimeout = config.batch.timeout;
    }

    if (config.fields && typeof config.fields === 'object') {
        for (key in config.fields) {
            if (typeof config.fields[key] !== 'function') {
                fields[key] = config.fields[key];
            }
        }
    }
    return logStashAppender(options, fields, layout);
}
815287
function LogTelemetryEvents(config) {
    var self = this;

    config = config || {};

    REQUIRED_CONFIG_PROPERTIES.forEach(function(property) {
        if (!(self["_" + property] = config[property])) {
            throw new Error("config is missing required property: " + property);
        }
    });
}
147953
function $stream(ctx, qs, initCB, config) {

    const $p = config.promise;

    // istanbul ignore next:
    // we do not provide code coverage for the Native Bindings specifics
    if (ctx.options.pgNative) {
        return $p.reject(new Error(npm.text.nativeStreaming));
    }
    if (!qs || !qs.constructor || qs.constructor.name !== 'PgQueryStream') {
        // stream object wasn't passed in correctly;
        return $p.reject(new TypeError(npm.text.invalidStream));
    }
    if (qs._reading || qs._closed) {
        // stream object is in the wrong state;
        return $p.reject(new Error(npm.text.invalidStreamState));
    }
    if (typeof initCB !== 'function') {
        // parameter `initCB` must be passed as the initialization callback;
        return $p.reject(new TypeError(npm.text.invalidStreamCB));
    }

    let error = npm.events.query(ctx.options, getContext());

    if (error) {
        error = getError(error);
        npm.events.error(ctx.options, error, getContext());
        return $p.reject(error);
    }

    const stream = ctx.db.client.query(qs);

    stream.on('data', onData);
    stream.on('error', onError);
    stream.on('end', onEnd);

    try {
        initCB.call(this, stream); // the stream must be initialized during the call;
    } catch (e) {
        release();
        error = getError(e);
        npm.events.error(ctx.options, error, getContext());
        return $p.reject(error);
    }

    const start = Date.now();
    let resolve, reject, nRows = 0, cache = [];

    function onData(data) {
        cache.push(data);
        nRows++;
        if (cache.length >= qs.batchSize) {
            notify();
        }
    }

    function onError(e) {
        release();
        stream.close();
        e = getError(e);
        npm.events.error(ctx.options, e, getContext());
        reject(e);
    }

    function onEnd() {
        release();
        notify();
        resolve({
            processed: nRows, // total number of rows processed;
            duration: Date.now() - start // duration, in milliseconds;
        });
    }

    function release() {
        stream.removeListener('data', onData);
        stream.removeListener('error', onError);
        stream.removeListener('end', onEnd);
    }

    function notify() {
        if (cache.length) {
            const context = getContext();
            error = npm.events.receive(ctx.options, cache, undefined, context);
            cache = [];
            if (error) {
                onError(error);
            }
        }
    }

    function getError(e) {
        return e instanceof npm.utils.InternalError ? e.error : e;
    }

    function getContext() {
        let client;
        if (ctx.db) {
            client = ctx.db.client;
        } else {
            error = new Error(npm.text.looseQuery);
        }
        return {
            client,
            dc: ctx.dc,
            query: qs.cursor.text,
            params: qs.cursor.values,
            ctx: ctx.ctx
        };
    }

    return $p((res, rej) => {
        resolve = res;
        reject = rej;
    });

}
49343
function LoggerConfiguration(logger) {
  /**
   * Override default logger instance with the provided logger
   * @public
   * @param {Object|Function} loggerOrFactoryFunction - the logger instance or factory function
   */
  function useLogger(loggerOrFactoryFunction) {
    cutil.assertObjectOrFunction(loggerOrFactoryFunction, 'loggerOrFactoryFunction');

    if (typeof(loggerOrFactoryFunction) === 'function') {
      logger = loggerOrFactoryFunction();
    }
    else {
      logger = loggerOrFactoryFunction;
    }
  };

  /**
   * Gets the default or overridden logger
   * @public
   */
  function getParams() {
    return { logger };
  }

  return {
    /**
     * Gets the target for a configurator function to run on
     * @public
     */
    getTarget: function() {
      return { useLogger: useLogger };
    },
    getParams: getParams
  };
}
950039
function createLoggerStream(name, level, logglyConfig) {
    const streams = [process.stdout];
    if (logglyConfig.enabled) {
        const logglyStream = new LogglyStream({
            token: logglyConfig.token,
            subdomain: logglyConfig.subdomain,
            name,
            environment: logglyConfig.environment,
        });
        streams.push(logglyStream);
    }
    return new UnionStream({ streams });
}
216138
function getPluginConfig (options, loggerConfig) {
  return Object.assign(options.hapiPino, {
    instance: pino(loggerConfig, options.stream),
    prettyPrint: false
  })
}
200339
function initLogging (config) {
    // only create logger if custom logging enabled
    if (config.logger !== true) {
        return
    }
    // create new logger instance
    var logger = new winston.Logger()
    // add transport
    logger.add(winston.transports.Console, {
        formatter: winstonFormatter,
        level: 'info'
    });
    // make logger accessible
    config.logger = logger
    // override console.log function
    console.log = function () {
        logger.info.apply(logger, formatArgs(arguments))
    }
    // override console.info function
    console.info = function () {
        logger.info.apply(logger, formatArgs(arguments))
    }
    // override console.warn function
    console.warn = function () {
        logger.warn.apply(logger, formatArgs(arguments))
    }
    // override console.error function
    console.error = function () {
        logger.error.apply(logger, formatArgs(arguments))
    }
    // override console.debug function
    console.debug = function () {
        logger.debug.apply(logger, formatArgs(arguments))
    }
}
188222
function(config, stream, extras, callback) {
    stream = stream.pipe(through.obj(function(file, enc, cb) {

      var contents = file.contents.toString();
      var changed = false;

      if(file.prev) {
        changed = true;
        file.prev.$el = file.prev.$el || cheerio.load(file.prev.contents.toString());
        var title = file.prev.$el('h1').first().text();
        contents = contents.replace(/MBINSERTPREVLABEL/g, title);
        var href = path.relative(path.dirname(file.relative), file.prev.relative);
        contents = contents.replace(/MBINSERTPREVHREF/g, href);
      }

      if(file.next) {
        changed = true;
        file.next.$el = file.next.$el || cheerio.load(file.next.contents.toString());
        var title = file.next.$el('h1').first().text();
        contents = contents.replace(/MBINSERTNEXTLABEL/g, title);
        var href = path.relative(path.dirname(file.relative), file.next.relative);
        contents = contents.replace(/MBINSERTNEXTHREF/g, href);
      }

      if(changed) {
        file.contents = new Buffer(contents);
        file.$el = undefined;
      }

      cb(null, file);

    }));
    callback(null, config, stream, extras);
  }
535923
function stream(opts) {
  opts = lo.isObject(opts) ? opts : {}
  config.input = opts.input || process.stdin
  config.output = opts.output || process.stdout
}
977775
function (config) {
        config = config || {};

        if (config.onStart !== undefined) {
            if (!isFunction(config.onStart)) {
                throw new core.TypeError({
                    code: 'application-configure',
                    message: "config.onStart must be a function"
                });
            }

            this.onStart = config.onStart;
        }

        if (config.onStop !== undefined) {
            if (!isFunction(config.onStop)) {
                throw new core.TypeError({
                    code: 'application-configure',
                    message: "config.onStop must be a function"
                });
            }
            this.onStop = config.onStop;
        }

        return this;
    }
464461
def _logger_stream(self):
        """"""
        sh = logging.StreamHandler()
        sh.set_name('sh')
        sh.setLevel(logging.INFO)
        sh.setFormatter(self._logger_formatter)
        self.log.addHandler(sh)
1029044
private TreeBuilder<ResourceMeta> addLogger(TreeBuilder<ResourceMeta> builder, Map<String,String> config) {
        String loggerName= getLoggerName();
        if (null != config.get(LOGGER_NAME)) {
            loggerName = config.get(LOGGER_NAME);
        }
        if (null == loggerName) {
            loggerName = ORG_RUNDECK_STORAGE_EVENTS_LOGGER_NAME;
        }
        logger.debug("Add log4j logger for storage with name: " + loggerName);
        return builder.listen(new StorageLogger(loggerName));
    }
611449
def set_loggers_from_config(config=None):
    
    config = config or app_config.logging
    for lname, lconfig in config.get('loggers', {}).iteritems():
        if 'level' in lconfig:
            level = getattr(logging, lconfig.level)
            assert isinstance(level, int)
            logger = logging.getLogger(lname)
            logger.setLevel(level)