Move examples into their own directory.
This commit is contained in:
27
examples/log-rolling.js
Normal file
27
examples/log-rolling.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var log4js = require('./lib/log4js')
|
||||
, log
|
||||
, i = 0;
|
||||
log4js.configure({
|
||||
"appenders": [
|
||||
{
|
||||
type: "console"
|
||||
, category: "console"
|
||||
},
|
||||
{
|
||||
"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);
|
||||
}
|
||||
|
||||
for ( ; i < 5000; i++) {
|
||||
doTheLogging(i);
|
||||
}
|
||||
Reference in New Issue
Block a user