Add log4js config setting
This commit is contained in:
parent
2786807f2f
commit
f4b95c5ca4
|
@ -11,8 +11,7 @@ if(process.argv.length != 3)
|
||||||
var padId = process.argv[2];
|
var padId = process.argv[2];
|
||||||
|
|
||||||
//initalize the database
|
//initalize the database
|
||||||
var log4js = require("../src/node_modules/log4js");
|
var settings = require("../src/node/utils/Settings");
|
||||||
log4js.setGlobalLogLevel("INFO");
|
|
||||||
var async = require("../src/node_modules/async");
|
var async = require("../src/node_modules/async");
|
||||||
var db = require('../src/node/db/DB');
|
var db = require('../src/node/db/DB');
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,11 @@ if(process.argv.length != 3)
|
||||||
//get the padID
|
//get the padID
|
||||||
var padId = process.argv[2];
|
var padId = process.argv[2];
|
||||||
|
|
||||||
var db, dirty, padManager, pad;
|
var db, dirty, padManager, pad, settings;
|
||||||
var neededDBValues = ["pad:"+padId];
|
var neededDBValues = ["pad:"+padId];
|
||||||
|
|
||||||
var npm = require("../src/node_modules/npm");
|
var npm = require("../src/node_modules/npm");
|
||||||
var async = require("../src/node_modules/async");
|
var async = require("../src/node_modules/async");
|
||||||
var log4js = require("../src/node_modules/log4js");
|
|
||||||
log4js.setGlobalLogLevel("INFO");
|
|
||||||
|
|
||||||
async.series([
|
async.series([
|
||||||
// load npm
|
// load npm
|
||||||
|
@ -35,6 +33,7 @@ async.series([
|
||||||
},
|
},
|
||||||
// load modules
|
// load modules
|
||||||
function(callback) {
|
function(callback) {
|
||||||
|
settings = require('../src/node/utils/Settings');
|
||||||
db = require('../src/node/db/DB');
|
db = require('../src/node/db/DB');
|
||||||
dirty = require("../src/node_modules/ueberDB/node_modules/dirty")(padId + ".db");
|
dirty = require("../src/node_modules/ueberDB/node_modules/dirty")(padId + ".db");
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,7 @@ require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
|
||||||
|
|
||||||
process.chdir(npm.root+'/..')
|
process.chdir(npm.root+'/..')
|
||||||
|
|
||||||
|
var settings = require("ep_etherpad-lite/node/utils/Settings");
|
||||||
var dirty = require("ep_etherpad-lite/node_modules/ueberDB/node_modules/dirty")('var/dirty.db');
|
var dirty = require("ep_etherpad-lite/node_modules/ueberDB/node_modules/dirty")('var/dirty.db');
|
||||||
var db = require("ep_etherpad-lite/node/db/DB");
|
var db = require("ep_etherpad-lite/node/db/DB");
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,13 @@
|
||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//Logging configuration. See log4js documentation for further information
|
||||||
|
// https://github.com/nomiddlename/log4js-node
|
||||||
|
"logconfig" :
|
||||||
|
{ "appenders": [
|
||||||
|
{ "type": "console" }
|
||||||
|
] },
|
||||||
|
|
||||||
//the default text of a pad
|
//the default text of a pad
|
||||||
"defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http:\/\/etherpad.org\n",
|
"defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http:\/\/etherpad.org\n",
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ var log4js = require('log4js')
|
||||||
, async = require('async')
|
, async = require('async')
|
||||||
;
|
;
|
||||||
|
|
||||||
// set up logger
|
|
||||||
log4js.replaceConsole();
|
log4js.replaceConsole();
|
||||||
|
|
||||||
var settings
|
var settings
|
||||||
|
@ -50,8 +49,6 @@ async.waterfall([
|
||||||
hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
||||||
hooks.plugins = plugins;
|
hooks.plugins = plugins;
|
||||||
|
|
||||||
//set loglevel
|
|
||||||
log4js.setGlobalLogLevel(settings.loglevel);
|
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ var path = require('path');
|
||||||
var argv = require('./Cli').argv;
|
var argv = require('./Cli').argv;
|
||||||
var npm = require("npm/lib/npm.js");
|
var npm = require("npm/lib/npm.js");
|
||||||
var vm = require('vm');
|
var vm = require('vm');
|
||||||
|
var log4js = require("log4js");
|
||||||
|
|
||||||
/* Root path of the installation */
|
/* Root path of the installation */
|
||||||
exports.root = path.normalize(path.join(npm.dir, ".."));
|
exports.root = path.normalize(path.join(npm.dir, ".."));
|
||||||
|
@ -106,6 +107,11 @@ exports.abiword = null;
|
||||||
*/
|
*/
|
||||||
exports.loglevel = "INFO";
|
exports.loglevel = "INFO";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* log4js appender configuration
|
||||||
|
*/
|
||||||
|
exports.logconfig = { appenders: [{ type: "console" }]};
|
||||||
|
|
||||||
/* This setting is used if you need authentication and/or
|
/* This setting is used if you need authentication and/or
|
||||||
* authorization. Note: /admin always requires authentication, and
|
* authorization. Note: /admin always requires authentication, and
|
||||||
* either authorization by a module, or a user with is_admin set */
|
* either authorization by a module, or a user with is_admin set */
|
||||||
|
@ -174,6 +180,10 @@ exports.reloadSettings = function reloadSettings() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log4js.configure(exports.logconfig);//Configure the logging appenders
|
||||||
|
log4js.setGlobalLogLevel(exports.loglevel);//set loglevel
|
||||||
|
log4js.replaceConsole();
|
||||||
|
|
||||||
if(exports.dbType === "dirty"){
|
if(exports.dbType === "dirty"){
|
||||||
console.warn("DirtyDB is used. This is fine for testing but not recommended for production.")
|
console.warn("DirtyDB is used. This is fine for testing but not recommended for production.")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue