Yup. More conventionally, you would calculate the log prior probability of each parameter and the log likelihood and then sum everything up to get the log posterior probability. So you can just keep a running sum, adding in the likelihood of each observation, the sum the log prior of any parameter values that have been proposed, etc. You can even have multiple “pieces” to your likelihood (e.g., the likelihood of multiple data sets, etc.).