mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
24 lines
403 B
JavaScript
24 lines
403 B
JavaScript
'use strict';
|
|
|
|
const log4js = require('../lib/log4js');
|
|
|
|
log4js.configure({
|
|
appenders: {
|
|
file: {
|
|
type: 'dateFile',
|
|
filename: 'thing.log',
|
|
numBackups: 3,
|
|
pattern: '.mm',
|
|
},
|
|
},
|
|
categories: {
|
|
default: { appenders: ['file'], level: 'debug' },
|
|
},
|
|
});
|
|
|
|
const logger = log4js.getLogger('thing');
|
|
|
|
setInterval(() => {
|
|
logger.info('just doing the thing');
|
|
}, 1000);
|