From 3ec7dc224b37173cf6d3418afad5a43b41e58d6e Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 17 Aug 2011 17:45:47 +0100 Subject: [PATCH] added a loglevel setting --- node/server.js | 3 +++ node/utils/Settings.js | 5 +++++ settings.json.template | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/node/server.js b/node/server.js index 56f58d945..9020f54b0 100644 --- a/node/server.js +++ b/node/server.js @@ -60,6 +60,9 @@ var serverName = "Etherpad-Lite " + version + " (http://j.mp/ep-lite)"; //cache 6 hours exports.maxAge = 1000*60*60*6; +//set loglevel +log4js.setGlobalLogLevel(settings.loglevel); + async.waterfall([ //initalize the database function (callback) diff --git a/node/utils/Settings.js b/node/utils/Settings.js index b6af57657..692074abe 100644 --- a/node/utils/Settings.js +++ b/node/utils/Settings.js @@ -52,6 +52,11 @@ exports.minify = true; */ exports.abiword = null; +/** + * The log level of log4js + */ +exports.loglevel = "INFO"; + //read the settings sync var settingsStr = fs.readFileSync("../settings.json").toString(); diff --git a/settings.json.template b/settings.json.template index 47663c8f3..a7afaecc9 100644 --- a/settings.json.template +++ b/settings.json.template @@ -34,5 +34,8 @@ /* This is the path to the Abiword executable. Setting it to null, disables abiword. Abiword is needed to enable the import/export of pads*/ - "abiword" : null + "abiword" : null, + + /* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */ + "loglevel": "INFO" }