This process gets really fun when you don't have a debugger. Just source and program. Add log, recompile. Add log, recompile. oy.
But I also try to write/architecture my code so that the big stuff always gets logged. In cases where the logging isn't as good as it should be, a few hundred lines of reflection/meta-programming can enable just enough aspect-oriented programming capabilities to enable this approach.