autolog4j
v0.0.2
Published
> use
Downloads
1
Readme
AUTOLOG4J
use
// 替换原有接口输出
let alog4j = require('autolog4j')(app);
alog4j.use(app, 'info');
// 新的日志记录
alog4j.logger('logger-name').info('日志内容');
默认配置
app.set('log4js',
{
appenders: {
ruleFile: {
type: 'dateFile',
filename: 'logs/log4js',
pattern: '-yyyy-MM-dd.log',
alwaysIncludePattern: true,
}
},
categories: {
default: {
appenders: [
'ruleFile'
], level: 'all'
},
},
replaceConsole: true,
pm2: true,
pm2InstanceVar: 'INSTANCE_ID',
});