title: How to include time with Exception.printStackTrace();?
body: <p>I am writing all my exception log in a text file.</p>
  
  <p>For example</p>
  
  <pre><code>pw= new PrintWriter(new FileWriter("EXCEPTION.txt", true));
  
  try
  { 
      do something!! 
  } catch (Exception e) {
      e.printStackTrace(pw);pw.flush();
  }
  </code></pre>
  
  <p>However, it is very hard to get the read the EXCEPTION.txt file when there are multiple exceptions. I think it would be better to include time in front of each exception.</p>
  
  <p>How can this be done?</p>