From d13b2fb3b4522cf918aa8cc47ed74df8f0664f7c Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 27 Jul 2011 21:21:43 +1000 Subject: [PATCH] turned off config file reloading by default --- lib/log4js.js | 2 +- test/logging.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/log4js.js b/lib/log4js.js index 304b633..2b55a6f 100644 --- a/lib/log4js.js +++ b/lib/log4js.js @@ -326,7 +326,7 @@ function initReloadConfiguration(filename, options) { function configure (configurationFileOrObject, options) { var config = configurationFileOrObject; if (config === undefined || config === null || typeof(config) === 'string') { - options = options || { reloadSecs: 60 }; + options = options || { }; if (options.reloadSecs) { initReloadConfiguration(config, options); } diff --git a/test/logging.js b/test/logging.js index b9821b3..724e345 100644 --- a/test/logging.js +++ b/test/logging.js @@ -418,10 +418,10 @@ vows.describe('log4js').addBatch({ } }, fakeConsole = { - 'name': 'console', + 'name': 'console', 'appender': function () { return function(evt) { logEvents.push(evt); }; - }, + }, 'configure': function (config) { return fakeConsole.appender(); } @@ -434,7 +434,7 @@ vows.describe('log4js').addBatch({ '../lib/log4js', { requires: { - 'fs': fakeFS, + 'fs': fakeFS, './appenders/console.js': fakeConsole }, globals: { @@ -444,6 +444,7 @@ vows.describe('log4js').addBatch({ } ); + log4js.configure(undefined, { reloadSecs: 30 }); logger = log4js.getLogger('a-test'); logger.info("info1"); logger.debug("debug2 - should be ignored"); @@ -458,7 +459,7 @@ vows.describe('log4js').addBatch({ var logEvents = args[1]; assert.length(logEvents, 3); assert.equal(logEvents[0].data[0], 'info1'); - assert.equal(logEvents[1].data[0], 'info3'); + assert.equal(logEvents[1].data[0], 'info3'); assert.equal(logEvents[2].data[0], 'debug4'); } }