Difference between Log4jConfigListener and Log4jSe

2019-07-05 00:44发布

I am trying to deploy a spring web app in tomcat with log4j logging. From what I see from reading up on log4j configuration you can do it as follows -

<context-param>
    <param-name>log4jConfiguration</param-name>
     <param-value>/WEB-INF/webdynamo-log4j.xml</param-value>
</context-param>

<context-param>
     <param-name>log4j.refresh.interval</param-name>
     <param-value>120</param-value>
</context-param>

And you also need a listener for this to work -

Couple of places I have seen -

    <listener>
        <listener-class>
            org.apache.logging.log4j.web.Log4jServletContextListener
        </listener-class>
    </listener>

and some places I have seen

 <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>

Wanted to understand if there is any fundamental difference in using these listeners. I see they are in different packages altogether.

0条回答
登录 后发表回答