You can't, basically. Reflection lets you get at instance (and static) variables but if you want to log local variables, you'll have to do so explicitly. It's possible that you could do a bit better using the profiling API, but that would be a pretty extreme step.