The usual basics are hard to beat. Error logs to pinpoint the location of a bug. Info logs too to observe data or possibly timing issues with multiple users or things. And of course source control. After you know where in the code the error is you can use the blame or annotate features to observe changes in that area of code. Branch or tag at release points so you can apply fixes to the production version of the code without pollution of in-dev features.