Write Error messages in log file.