Adjust error logging into database