added example on pattern tokens usage

This commit is contained in:
Jan Schmidle 2013-02-08 16:18:27 +01:00
parent 5c75ba9468
commit af428c5669

View File

@ -0,0 +1,21 @@
var log4js = require("log4js");
var config = {
"appenders": [
{
"type": "console",
"layout": {
"type": "pattern",
"pattern": "%[%r (%x{pid}) %p %c -%] %m%n",
"tokens": {
"pid" : function() { return process.pid; }
}
}
}
]
};
log4js.configure(config, {});
var logger = log4js.getLogger("app");
logger.info("Test log message");