Mike's fix for outputWriter bug and fix log to handle local server case
better