I’ve created a Java Class that implements javax.naming.spi.ObjectFactory, and I’ve set up Tomcat’s context XML to use this class instead of the default.
Generally, we use log4j with our webapps, but we haven’t converted Tomcat to primarily use log4j (and we aren’t particularly interested in setting it up).
I’m not terribly concerned about how we do it, or which system we implement (if any), but how can I get this class to log SOMEWHERE on the system (catalina.out would even be sufficient)?
Thanks,
The simple way is to use System.out.println(). The more complicated and more flexible way is to use slf4j. Slf4j is cool because the underlying implementation be any of the available logging systems out there, including log4j. It was written by the guy who wrote log4j.