Unable to write to log file