|
|
|
@ -591,16 +591,19 @@ module.exports = function (fileSystem, standardOutput, configPaths) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function configure (configurationFile) {
|
|
|
|
|
if (configurationFile) {
|
|
|
|
|
try {
|
|
|
|
|
var config = JSON.parse(fs.readFileSync(configurationFile, "utf8"));
|
|
|
|
|
configureAppenders(config.appenders, fileAppender, consoleAppender);
|
|
|
|
|
configureLevels(config.levels);
|
|
|
|
|
function configure (configurationFileOrObject) {
|
|
|
|
|
var config = configurationFileOrObject;
|
|
|
|
|
if (typeof(config) === "string") {
|
|
|
|
|
config = JSON.parse(fs.readFileSync(config, "utf8"));
|
|
|
|
|
}
|
|
|
|
|
if (config) {
|
|
|
|
|
try {
|
|
|
|
|
configureAppenders(config.appenders, fileAppender, consoleAppender);
|
|
|
|
|
configureLevels(config.levels);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw new Error("Problem reading log4js config file " + configurationFile + ". Error was \"" + e.message + "\" ("+e.stack+")");
|
|
|
|
|
throw new Error("Problem reading log4js config " + sys.inspect(config) + ". Error was \"" + e.message + "\" ("+e.stack+")");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function findConfiguration() {
|
|
|
|
|