All tests pass, moved appenders into separate files, so that extra ones can be added easily

This commit is contained in:
Gareth Jones
2011-07-26 08:52:40 +10:00
parent 545681287f
commit ef9fe3a4b1
7 changed files with 276 additions and 139 deletions

28
log-rolling.js Normal file
View File

@@ -0,0 +1,28 @@
var log4js = require('./lib/log4js')
, log
, i = 0;
log4js.configure({
"appenders": [
{
"type": "file",
"filename": "tmp-test.log",
"maxLogSize": 1024,
"backups": 3,
"pollInterval": 0.1,
"category": "test"
},
{
type: "console"
, category: "console"
}
]
});
log = log4js.getLogger("test");
function doTheLogging(x) {
log.info("Logging something %d", x);
}
for ( ; i < 100000; i++) {
doTheLogging(i);
}