123456789101112131415161718192021222324 |
- var log4js=require('log4js');
- log4js.configure({
- appenders: {
- out: { type: 'stdout' },//设置是否在控制台打印日志
- info: {
- type: 'file',
- filename: __dirname.split("winBoxNode")[0]+"/Logs/lingjiao.log",
- pattern: "_yyyy-MM-dd",
- alwaysIncludePattern: false,
- category: 'dateFileLog'
- }
- },
- categories: {
- default: { appenders: [ 'out', 'info' ], level: 'info' }//去掉'out'。控制台不打印日志
- }
- });
- var logger = log4js.getLogger('info');
- module.exports = logger;
|