R
robert walker
hi all, from reading the jdk1.4 logging docs
they use an example like
public class HelloWorld {
private static Logger theLogger =
Logger.getLogger(HelloWorld.class.getName());
public static void main(String[] args) {
HelloWorld hello = new HelloWorld();
hello.sayHello();
}
public void sayHello() {
theLogger.finest("Hello logging!");
}
}
I only want one logger for all class files, and do not want to
have to have a static instance for each class I need to do logging
does anyone have an example of how to setup a singleton,
I will be running this from tomcat, so would like an init servlet
to setup the logging configuration, (basically just the level)
and then let all servlets use this singlteon to log
they use an example like
public class HelloWorld {
private static Logger theLogger =
Logger.getLogger(HelloWorld.class.getName());
public static void main(String[] args) {
HelloWorld hello = new HelloWorld();
hello.sayHello();
}
public void sayHello() {
theLogger.finest("Hello logging!");
}
}
I only want one logger for all class files, and do not want to
have to have a static instance for each class I need to do logging
does anyone have an example of how to setup a singleton,
I will be running this from tomcat, so would like an init servlet
to setup the logging configuration, (basically just the level)
and then let all servlets use this singlteon to log