tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Lyle" <t...@limehouse.co.uk>
Subject Java Logging API and stderr.log
Date Tue, 29 Apr 2003 10:24:23 GMT
Hi All,

I have a webservices application running as an NT service on Tomcat 4.1,
Windows 2000 server and i've been using the Java Logging API to redirect all
the log messages to my own log files which i've initialised in the following
manner:

private static void initialiseLogs(){
//initialise dao log
Logger.getLogger(DAO_LOG).addHandler(getHandler(DAO_LOG));
//initailise other logs....
//
//
}

private static Handler getHandler(String name) throws IOException{
Handler handler = new FileHandler(LOG_FOLDER + File.separator + name
+".log");
handler.setFormatter(new SimpleFormatter());
//set the handlers log level
handler.setLevel(Level.SEVERE);
return handler;
}

Now this works fine, in that i only get SEVERE messages written to my dao
log file, and if i set the level to INFO i get everything written to the
file. The problem is that no matter what i set the level to ALL my log
messages get written to the Tomcat stderr.log as well(which resides at:
C:\Program Files\Apache Group\Tomcat 4.1\logs\stderr.log)

Since, like a good little programmer, i had log.info() statements all over
my code during development this means that the stderr.log gets very big very
quickly. How do i stop tomcat writing everything to stderr? And why is it
doing it in the first place? I have no System.err.println() anywhere in the
code(except to catch the log initialisation exception). I'm guessing that
its something to do with the configuration of the Java Logging API but i'm
at a loss as to what as this is the first time i've used it.

Any help much appreciated

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message