title: Convert e.printStackTrace() to use log4j instead
body: <p>I am very new to log4j.  I do not want to show exception stack trace in my log file such as</p>
  
  <pre><code>java.lang.IllegalArgumentException: nodeRef is a mandatory parameter
  at org.alfresco.util.ParameterCheck.mandatory(ParameterCheck.java:42)
  </code></pre>
  
  <p>These exceptions are written directly to console by using <code>e.printStackTrace()</code> like that</p>
  
  <pre><code>try {
      // something
  } catch(Exception e) {
      StringWriter stack = new StringWriter();
      e.printStackTrace(new PrintWriter(stack));
      logger.debug("Caught exception; decorating with appropriate status template : " + stack.toString());
  }
  </code></pre>
  
  <p>I am now <strong>customizing a Open Source</strong> project, not writing all my programs by myself. 
  So it is impossible to remove <code>e.printStackTrace();</code> in all of java files.</p>
  
  <p>As far as I know, log which are printed by <code>log4j</code> with logger can be configured by using log4j error level such as info, debug, warn.But how about writing directly to console or file?</p>
  
  <p><strong>How can I configure log4j not to print only exception stacktrace but show other information? Is there a way to solve it out?</strong></p>