Updated write method for error log (write+append)