'use strict';
const winston = require( 'winston' );
require(__dirname + '/winston-fluent').Fluent; //jshint ignore: line
// remember to specify tag: and label: in custom
exports.fluentTransport = (config, custom) =>
new winston.transports.Fluent(Object.assign({
options: {
host: config.fluentd.host,
port: parseInt(config.fluentd.port, 10),
timeout: parseInt(config.fluentd.socket_timeout_ms, 10),
reconnectInterval: parseInt(config.fluentd.reconnect_interval_ms, 10)
}
}, custom));
exports.fluent = (config, custom) => new (winston.Logger)({
transports: [exports.fluentTransport(config, custom)],
exitOnError: false
});
|