You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "KARR, DAVID" <dk...@att.com> on 2016/09/06 15:22:36 UTC
What happens if I do NOT add the listener and filter in a servlet
2.5 webapp?
I'm looking at running a webapp in a version of WebLogic that appears to only support (at maximum) the Servlet 2.5 spec. The Log4j2 docs talk about using Log4j2 in a Servlet 2.5 container, at https://logging.apache.org/log4j/2.x/manual/webapp.html#Servlet-2.5 .
This page says the following:
"If you are using Log4j in a Servlet 2.5 web application, or if you have disabled auto-initialization with the isLog4jAutoInitializationDisabled context parameter, you must configure the Log4jServletContextListener and Log4jServletFilter in the deployment descriptor or programmatically."
Nowhere does it say WHY this MUST be done, what this causes when you do it, or even what the consequences are if you do not do this (ok, probably same as the first point).
I have a feeling the main reason these are required is not for startup, but for shutdown, but again, I see no clear information either way.
I ended up deploying this app to that container, without adding these, and I saw no obvious symptoms.
In addition to the above questions, I need to understand what the impact is, if any, to having this listener and filter running in a Servlet container newer than 2.5. I would guess it would cause no harm, but again, no information means no information.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: What happens if I do NOT add the listener and filter in a servlet
2.5 webapp?
Posted by Matt Sicker <bo...@gmail.com>.
It's to automatically shut down the LoggerContext when you undeploy a
webapp. If you don't undeploy or redeploy webapps, you don't really need to
use it.
On 6 September 2016 at 10:22, KARR, DAVID <dk...@att.com> wrote:
> I'm looking at running a webapp in a version of WebLogic that appears to
> only support (at maximum) the Servlet 2.5 spec. The Log4j2 docs talk about
> using Log4j2 in a Servlet 2.5 container, at https://logging.apache.org/
> log4j/2.x/manual/webapp.html#Servlet-2.5 .
>
> This page says the following:
> "If you are using Log4j in a Servlet 2.5 web application, or if you have
> disabled auto-initialization with the isLog4jAutoInitializationDisabled
> context parameter, you must configure the Log4jServletContextListener and
> Log4jServletFilter in the deployment descriptor or programmatically."
>
> Nowhere does it say WHY this MUST be done, what this causes when you do
> it, or even what the consequences are if you do not do this (ok, probably
> same as the first point).
>
> I have a feeling the main reason these are required is not for startup,
> but for shutdown, but again, I see no clear information either way.
>
> I ended up deploying this app to that container, without adding these, and
> I saw no obvious symptoms.
>
> In addition to the above questions, I need to understand what the impact
> is, if any, to having this listener and filter running in a Servlet
> container newer than 2.5. I would guess it would cause no harm, but again,
> no information means no information.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
--
Matt Sicker <bo...@gmail.com>