Skip to content

Commit

Permalink
fix: updated streamroller to fix log rolling when appending
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Jones committed Mar 25, 2019
1 parent e4611e1 commit e290b6f
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 57 deletions.
31 changes: 31 additions & 0 deletions examples/log-rolling-bug.js
@@ -0,0 +1,31 @@
const log4js = require('../lib/log4js');

log4js.configure({
appenders: {
handler: {
type: 'file',
filename: 'logs/handler.log',
maxLogSize: 100000,
backups: 5,
keepFileExt: true,
compress: true
}
},
categories: {
default: { appenders: ['handler'], level: 'debug' },
handler: { appenders: ['handler'], level: 'debug' },
}
});

const logsToTest = [
'handler'
];

const logStartDate = new Date();

const loggers = logsToTest.map(log => log4js.getLogger(log));

// write out a lot
setInterval(() => {
loggers.forEach(logger => logger.info(`TESTING LOGGER!!!!!!${logStartDate}`));
}, 10);

0 comments on commit e290b6f

Please sign in to comment.