logger.js 502 Bytes
  
/**
 * 日志工具类
 * @author: hbomb<qiqi.zhou@yoho.cn>
 * @date: 2016/05/06
 */
  'use strict';
  
  let winston = require('winston'),
  config = require('../config/common');
  
  require('influxdb-winston');
  
  let logger = new (winston.Logger)({
    transports: [
      new (winston.transports.File)(config.loggers.file),
      new (winston.transports.UdpTransport)(config.loggers.udp),
      new (winston.transports.Console)(config.loggers.console)
    ]
  });
  
 module.exports = logger;