Small incremental builds. During active development, add to your project piece-by-piece and test each incoming piece. Don't spew out a bunch of code and then mash Run and blithely correct each error. Add to your program piece by piece and take the time to fix everything. Try to make each increment in your project 'atomic'.
Multi-level logging, as others have already pointed out. Have a severity scale running from trace up to fatal error and everything in between. Your production app should log every single thing that it does and why it succeeded or failed, but you should also be able to alter the logging level when an extreme level of detail is not needed. Logs should be human readable as a first priority.
Fail-safe logging. Don't depend on your logging mechanism to survive exceptional situations. Always have a back up plan - the event log, a flat text file, a last ditch email - for when things go bottoms up.
Good source control policy. Frequent check-ins on a regular schedule at minimum, plus check-ins for any and all groups of changes, particularly widespread or possibly breaking changes.