Quoting Adrian Robert <[EMAIL PROTECTED]>: > > Understandable. I was a little dismayed to see that what had been more > > automatic in Tomcat-5.0.xx had become less so in Tomcat-5.5. What I > > mean is, > > in Tomcat-5.0.xx, one could add a <Logger> to the context > > configuration file, > > deploy that with the webapp, and dynamically get a log file for > > ServletContext.log() output. In Tomcat-5.5, one has to have this in > > the logger > > config file at Tomcat startup, therefore forcing one to predict the > > apps that > > will be deployed to the appserver during runtime > ... > > I was trying to achieve this with multiple > >> separate log4j.properties, one in the container (common/classes/) for > >> the uncaught stack trace and other general logging, and others in each > >> webapp. With my setup below I was expecting to get THREE files: > >> catalina.out (with stdout/err), tomcat.log (with the container's log4j > >> output), and bar.log (with the webapp's log4j output, which I changed > >> from ServletContext.log() to use Logger.info()). Instead, I got only > >> catalina.out and tomcat.log, the latter containing everything that I > >> thought the webapp would be sending to bar.log. > >> > > > > And this should have worked. It works in every case I have ever > > tried. I > > suggest you double and triple check that you have log4j.jar in both > > common/lib > > and WEB-INF/lib and make sure you have log4j.properties in both > > common/classes > > and WEB-INF/classes. > > OK, thanks to your vote of confidence in the method, I dug further and > discovered that my WEB-INF/classes/log4j.properties was never being > found. If I put the log4j.properties into the same jar (in > WEB-INF/lib) with the class that was instantiating the Logger, it > worked correctly. >
That's extremely odd. What version of Tomcat are you running? That's a bug because WEB-INF/classes should be put in the classpath before jars in WEB-INF/lib. Jake > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
