title: Getting stacktrace in logger
body: <p>I am using log4j to log my exceptions. I want to log whatever I get in <code>e.printStackTrace();</code><br>
  My code looks like this:</p>
  
  <pre><code>try {
  
  } catch(Exception e) {
      log.error("Exception is:::" + e);
  }
  </code></pre>
  
  <p>But the content I get logged looks like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>2012-02-02 12:47:03,227 ERROR [com.api.bg.sample] - Exception in unTech:::[Ljava.lang.StackTraceElement;@6ed322
  2012-02-02 12:47:03,309 ERROR [com.api.bg.sample] - Exception is :::java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  </code></pre>
  
  <p>But the content I expect is:</p>
  
  <pre class="lang-none prettyprint-override"><code>java.io.IOException: Not in GZIP format
  at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
  at java.util.zip.GZIPInputStream.&lt;init&gt;(Unknown Source)
  at java.util.zip.GZIPInputStream.&lt;init&gt;(Unknown Source)
  at com.api.bg.sample.unGZIP(sample.java:191)
  at com.api.bg.sample.main(sample.java:69)
  </code></pre>
  
  <p>I tried <code>e.getMessage()</code>, <code>e.getStackTrace();</code> however I don't get the full stacktrace. Any suggestions?</p>