title: Best Practice of logging an uncaught exception in a java programm
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1548487/java-global-exception-handler">Java: Global Exception Handler</a>  </p>
  </blockquote>
  
  
  
  <p>I thought of something like this:</p>
  
  <pre><code>public static void main(String[] args) {
    try {
      startOfMyProg();
    } catch (RuntimeException e) {
       log.error(e.toString());
       // Maybe rethrow it so i can see it in the console?
    }
  }
  </code></pre>
  
  <p>It's a simple solution, i know. Maybe someone knows a better one?</p>
  
  <p>regards &amp;&amp; tia
    noircc</p>