Android - print full exception backtrace to log
<p>I have a try/catch block that throws an exception  and I would like to see information about the exception in the Android device log.</p>

<p>I read the log of the mobile device with this command from my development computer:</p>

<pre><code>/home/dan/android-sdk-linux_x86/tools/adb shell logcat
</code></pre>

<p>I tried this first:</p>

<pre><code>try {
    // code buggy code
} catch (Exception e)
{
    e.printStackTrace();
}
</code></pre>

<p>but that doesn't print anything to the log. That's a pity because it would have helped a lot.</p>

<p>The best I have achieved is:</p>

<pre><code>try {
    // code buggy code
} catch (Exception e)
{
    Log.e("MYAPP", "exception: " + e.getMessage());             
    Log.e("MYAPP", "exception: " + e.toString());
}
</code></pre>

<p>Better than nothing but not very satisfying.</p>

<p>Do you know how to print the full backtrace to the log?</p>

<p>Thanks.</p>
