logErrorMsg() is executed atomically (the file lock is obtained).