You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Oliver Jonas <ol...@dialogue.co.uk> on 2003/01/06 14:37:09 UTC

J2SDK1.4 logging and reloading webapps

Hi,

I'm making use of the java.util.logging package and extend Logger as shown:

import java.util.logging.*;

public class ClassLogger extends Logger {
 public ClassLogger(String name, String resourceBundleName) {
  super(name, resourceBundleName);
  if(!LogManager.getLogManager().addLogger(this)) {
      System.out.println("Failed to add logger: " + getName());
  }
 }

.
.
.

}

I use this logger in my classes using:

protected static ClassLogger logger = new ClassLogger("my name", null);

All this works fine until I reload the webapp using the Tomcat manager.
After that it fails adding the logger using addLogger and entries are not
logged anymore.

I assume the problems occur because on reloading Tomcat is using a new class
loader and because the logger is a static member it somehow doesn't update
the instance.

I've tried calling reset() on the LogManager instance but it doesn't help.

I'm using Tomcat 4.1.18.

Can anyone help me?

Thanks.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 30/12/2002


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>