Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 24
Registered: ‎08-07-2008
My Device: Not Specified

How to get stacktrace from a real device

How can we can the stacktrace of an exception happening on a real device? If I do "exception.printStacktrace()" it goes on the standard output. Is there a way to collect it?

I'm using right now a 8700 model. 

Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: How to get stacktrace from a real device

Change your catch block to catch Throwable instead of the specific Exception.  This will keep the stack trace and add it to the event log.  See this thread for details on viewing the event log.
Kurt Zettel | Chief Architect | Metova
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to get stacktrace from a real device

This is an on-going issue for us. My support folks want to take me out back and beat the heck out of me every time I ask them to collect a stack trace. We haven't found any way to accomplish this programmatically. If you search this forum, you will find another thread on the subject.


You can locate the trace manually by going to the home screen and typing the back-door sequence <alt> LGLG. You then filter through the log and locate the exception entry. You can then copy and send the trace via email.


Not elegant, and it is usually more trouble than it is worth.


AFAIK, no commitment from RIM yet on getting us access to the log.