It add useful meta data of code (file-name, function-name line-number, column-number) for log4js-node
.
[2014-02-18 12:24:14.238] [INFO] category - test at <anonymous> (test.js:57:9)
npm install log4js-extend
const log4js = require("log4js");
const log4js_extend = require("log4js-extend");
log4js_extend(log4js, {
path: __dirname,
format: "at @name (@file:@line:@column)"
});
const logger = log4js.getLogger("category");
logger.info("test");
Use relative path from path directory.
default: null
Simple log format.
default: "at @name (@file:@line:@column)"