log4j « Filter « JSP-Servlet Q&A





1. Where to declare log4j in servlets and filters?    stackoverflow.com

I am confusing when I try log the process using log4j, I don't know where to put the logger. Now I've put the logger in the servlet and declared it as public ...

2. servlet-filters precedence    stackoverflow.com

Since since filters are chained one after another, I cannot know when to remove MDC/NDC (log4j) information. Which is the topmost servlet filter? I have one defined inside deploy/jboss-portal-ha.sar/portal-server.war/WEB-INF/Web.xml and several others spread around ...

3. Order of calling destroy() method on servlets/filters    stackoverflow.com

I have a Java web app. I can specify the order of calling init() method on servlets by the parameter in web.xml:

<load-on-startup>1</load-on-startup>
But, how can I specify the order of calling destroy() methods? Actually, ...