title: No response on invoke classes inside servlet
body: <h2>Changed</h2>
  <p>I'm trying to make a servlet and make use of non-servlet classes to manage database connection and user authorization.I'm using a log file to track when a transaction is been done.My problem is I get no entries when I invoke the below class from the servlet class instead I get result when I call it from a non-servlet class.</p>
  <pre><code>package api;
  
  import java.io.File;
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.PrintStream;
  import java.text.DateFormat;
  import java.text.SimpleDateFormat;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  import java.util.Date;
  
  public class DBase {
  
     private PrintStream outstream;
  
      public DBase( )
      {
          try {
              
              File file = new File(&quot;log&quot;);
  
              boolean exists = file.exists();
              if (exists) {
                  outstream = new PrintStream(new FileOutputStream(&quot;log&quot;,true));
              } else {
                 outstream = new PrintStream(new FileOutputStream(file,true));
              }
              System.setOut(outstream);
              System.setErr(outstream);
              System.out.println(&quot;\n&quot; + getDateTime() + &quot;\nInvoker: &quot; + getClass().getName());
              
          } catch (FileNotFoundException ex) {
              Logger.getLogger(DBase.class.getName()).log(Level.SEVERE, null, ex);
          } 
      }
  
      private String getDateTime() {
        DateFormat dateFormat = new SimpleDateFormat(&quot;yyyy/MM/dd HH:mm:ss&quot;);
        Date date = new Date();
        return dateFormat.format(date);
     }
  }
  </code></pre>
  <p>Invoke the class from a non-servlet class gives me entries in the log file.</p>
  <pre><code>package api;
  
  
  public class Test {
      
      public static void main(String args[]){    
                DBase dbase = new DBase();
      }
  }
  </code></pre>
  <p>Here I got nothing.
  It's in <code>package servlets</code></p>
  <pre><code>    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
          response.setContentType(&quot;text/html;charset=UTF-8&quot;);
          PrintWriter out = response.getWriter();
          try {
              new api.Test(); //or new api.DBase();
          } finally { 
              out.close();
          }
      } 
  </code></pre>
  <p><em>I'm using Netbeans 6.8 and Tomcat6</em></p>