diff --git a/lib/log4js.js b/lib/log4js.js index 7f020d5..653d4bc 100644 --- a/lib/log4js.js +++ b/lib/log4js.js @@ -302,13 +302,12 @@ function loadConfigurationFile(filename) { function configureOnceOff(config, options) { if (config) { try { + restoreConsole(); configureLevels(config.levels); configureAppenders(config.appenders, options); if (config.replaceConsole) { replaceConsole(); - } else { - restoreConsole(); } } catch (e) { throw new Error(