-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris,
On 2/9/12 2:40 PM, C C wrote: > To test, I created a webapp with a single servlet, > ExceptionServlet, that simply throw a ServletException in its > service() method, e.g.: > > public class ExceptionServlet extends HttpServlet { protected void > service(HttpServletRequest arg0, HttpServletResponse arg1) > > throws ServletException, IOException { throw new > ServletException("HEY SERVLET EXCEPTION"); } } > > > Further, the webapp uses log4j (1.2.16) and commons-logging > (1.1.1). The log4j.properties for the webapp looks like this: > > log4j.rootLogger=INFO,A > log4j.appender.A=org.apache.log4j.RollingFileAppender > > log4j.appender.A.file=/opt/personal/logs/ex/ex.info.log > log4j.appender.A.layout=org.apache.log4j.PatternLayout > log4j.appender.A.layout.conversionPattern=%m%n > log4j.appender.A.maxFileSize=10MB > log4j.appender.A.maxBackupIndex=10 So log4j.properties is located in WEB-INF/classes? Where is log4j.jar? Do you have any other code in this example webapp -- for instance, something that actually loads the log4j.properties file? In order to use log4j with Tomcat 6.0 and 7.0, you need to download some Tomcat "extras" as described here: http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j So if you haven't done that, then log4j will not be used at all, unless you have both written some code to initialize log4j during webapp startup and written an error handler to capture errors and log them to some kind of log. > In a default deployment of Tomcat 5.5.26, I drop the webapp in the > webapps directory, start up Tomcat, and call the ExceptionServlet. > The resultant exception message and stack trace appear in the log > file specified by the webapp's log4j.properties file, as I would > expect. I wouldn't expect that at all, unless your log4j.properties file lives at the server level and not at the webapp level. So, which is it? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk80NAcACgkQ9CaO5/Lv0PAuJgCgvnWXtgCUS5qbrIBJBd3/u88d lFQAn1VeFSs4kEv9S5c/6WEOh0LNMYD7 =oB/i -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org