Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to see a complete stack trace from android?

Tags:

android

When I get an uncaught exception in my app and the trace prints to the logcat, is there anyway to make the entire trace print out? At the end of the trace it always has something like "...10 more".

Example:
03-11 16:25:53.572: ERROR/AndroidRuntime(3297): Caused by: java.lang.ClassNotFoundException: net.notify.notifymdm.listeners.PackageInstallerReceiver in loader dalvik.system.PathClassLoader[/data/app/net.notify.notifymdm-2.apk] 03-11 16:25:53.572: ERROR/AndroidRuntime(3297): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 03-11 16:25:53.572: ERROR/AndroidRuntime(3297): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 03-11 16:25:53.572: ERROR/AndroidRuntime(3297): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 03-11 16:25:53.572: ERROR/AndroidRuntime(3297): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2780) 03-11 16:25:53.572: ERROR/AndroidRuntime(3297): ... 10 more

like image 897
Lysandus Avatar asked Mar 11 '11 21:03

Lysandus


People also ask

How do I print a full stack trace?

If you want to log an exception and want to include the full stack trace with all nested exceptions, you should use the printStackTrace method from Throwable and get the result as a String: StringWriter sw = new StringWriter(); pThrowable. printStackTrace(new PrintWriter(sw)); String fullStackTrace = sw. toString();

What is full stack trace?

A full stack trace allows you to see the chain of files from when your custom tag reached your set breakpoint. If you click on any of the pages in the caller chain then FusionDebug will show you that page and will highlight the line at which the next page in the chain was called.

What does the stack trace contain?

The stack trace, also called a backtrace, consists of a collection of stack records, which store an application's movement during its execution. The stack trace includes information about program subroutines and can be used to debug or troubleshoot and is often used to create log files.


1 Answers

Usually the "...N more" represents n more lines of the same error, anyway.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Throwable.html#printStackTrace%28%29

like image 66
Turnsole Avatar answered Oct 19 '22 19:10

Turnsole