diff --git a/lib/log4js.js b/lib/log4js.js index 5a2dcd6..66c320c 100644 --- a/lib/log4js.js +++ b/lib/log4js.js @@ -324,14 +324,20 @@ function initReloadConfiguration(filename, options) { function configure (configurationFileOrObject, options) { var config = configurationFileOrObject; + options = options || {}; + if (options.hasOwnProperty('cwd')) { + config.appenders.forEach(function(appender) { + if (appender.hasOwnProperty('filename')) { + appender.filename = options.cwd + '/' + appender.filename; + } + }); + } if (config === undefined || config === null || typeof(config) === 'string') { - options = options || { }; if (options.reloadSecs) { initReloadConfiguration(config, options); } configureOnceOff(loadConfigurationFile(config)); } else { - options = options || {}; if (options.reloadSecs) { getLogger('log4js').warn('Ignoring configuration reload parameter for "object" configuration.'); }