LjLogHelper.js 420 B

123456789101112131415161718
  1. var log4js=require('log4js');
  2. log4js.configure({
  3. appenders: {
  4. out: { type: 'stdout' },//设置是否在控制台打印日志
  5. info: { type: 'file', filename: 'c:/efunbox/logs/lingjiao.log' }
  6. },
  7. categories: {
  8. default: { appenders: [ 'out', 'info' ], level: 'info' }//去掉'out'。控制台不打印日志
  9. }
  10. });
  11. var logger = log4js.getLogger('info');
  12. module.exports = logger;