tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: Java Logging API and stderr.log
Date Wed, 30 Apr 2003 07:07:55 GMT
Tomcat uses commons-logging,
which falls back to JDK1.4 logging if available.  You can override this by
setting CATALINA_OPT like:

"Tom Lyle" <> wrote in message
> 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
> the log messages to my own log files which i've initialised in the
> 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 statements all over
> my code during development this means that the stderr.log gets very big
> 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
> 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:
For additional commands, e-mail:

View raw message