Servers like JRun and other provide separate logs where all your print requests print their data. For example requests to System.out. And System.err goes to different log files. If you want to maintain logs separately for each module then you can create a static class called "LogWriter" and call the method inside the try catch loop as follows.

   try
  { 
    // write your code here
  }
  catch(Exception e)
  {
    LogWriter.print("Debug : error occurred at function ")
  }