Check errors and save log