Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updated streamroller to fix log rolling when appending
- Loading branch information
Gareth Jones
committed
Mar 25, 2019
1 parent
e4611e1
commit e290b6f
Showing
3 changed files
with
88 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
Oops, something went wrong.