write error log