2011-07-26 06:52:40 +08:00
|
|
|
var log4js = require('./lib/log4js')
|
|
|
|
, log
|
|
|
|
, i = 0;
|
|
|
|
log4js.configure({
|
|
|
|
"appenders": [
|
2011-11-21 12:03:51 +08:00
|
|
|
{
|
|
|
|
type: "console"
|
|
|
|
, category: "console"
|
|
|
|
},
|
2011-07-26 06:52:40 +08:00
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"filename": "tmp-test.log",
|
|
|
|
"maxLogSize": 1024,
|
|
|
|
"backups": 3,
|
|
|
|
"category": "test"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
log = log4js.getLogger("test");
|
|
|
|
|
|
|
|
function doTheLogging(x) {
|
|
|
|
log.info("Logging something %d", x);
|
|
|
|
}
|
|
|
|
|
2011-11-21 12:03:51 +08:00
|
|
|
for ( ; i < 5000; i++) {
|
2011-07-26 06:52:40 +08:00
|
|
|
doTheLogging(i);
|
|
|
|
}
|