I found a partial solution (requires Java 6):

I wrote my own class:

class MyLogger {

   public static void log(String message) {
       if(System.console() != null) System.console().printf("consoleLogger: 
%s\n", message);
   }
}

This has the unique advantage of working, unlike System.out.

It still has the disadvantage that I can't see unchecked exceptions.  It is 
workable, though, because I can put in a series of points:

MyLogger.log("I'm at step 12");
// do something
MyLogger.log("I'm at step 13");


and if it never gets to step 13, I know to put a try { } catch { } block in 
there and then I can print the exception to console.

But this is all crazy.  There must be some more modern way of achieving this: 
sending log messages (either to console or a file) and logging exceptions 
(either to a file or console).  Is some system of "dump all exceptions to the 
console" possible in Tomcat?






 
____________________________________________________________________________________
Don't get soaked.  Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to