Re: log4j initialization does not seem to happen when Tomcat service is started
"Piotr P. Karwasz" <[email protected]> Sun, 31 Mar 2024 22:54:26 +0200
| Newsgroups | gmane.comp.jakarta.log4j.user |
|---|---|
| Message-ID | <CAFmygFZPv+G6jU7R+HoY61NGzoHtoTe7yYwC9dDAxXQF-ZXnSQ@mail.gmail.com> |
Hi Piers, On Sun, 31 Mar 2024 at 22:37, Piers Uso Walter <[email protected]> wrote: > > Thad, > > > Thanks so much. This looks exactly what I want to do. > But somehow I never got your code to work. > > ... > > I made these changes to your code: > > 1. > LogListener is now a subclass of Log4jServletContextListener, instead of just implementing ServletContextListener. > So I’m only declaring a single listener in web.xml. > > 2. > I’m not using the servlet init parameter Log4jWebSupport.LOG4J_CONFIG_LOCATION to set the config file location. > Instead, I’m initializing a log4j Configurator from the file. Consider also setting the servlet init parameter `isLog4jAutoInitializationDisabled` to `true` to disable the servlet container initializer. Piotr