added file logging controlled by config.js parameter