For any application, We can debug it through Logging.
If you happen to read
http://code.google.com/appengine/articles/logging.html,
you might discover exact solution if you are using the python runtime.
Or if you are using java runtime, you should ve been familiar to
Logging concepts.
You can put Logger.log("Something happened at this statement...")...
at various places in your code.