Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
More test info trying to isolate the problem: Task: developing web app project on eclipse 2019 version. main project includes a dependent project (sub-project) on the same eclipse. Run main app as java app: main app vm parameters include: -Dlog4j.configurationFile, LogManager.getLogger() retu

Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Mark, I also use log4j2 in my web app. dev in eclipse, when adding the log4j2 jars to tomcat 7,8, or 9 runtime, it has this problem, log4j2.xml is provided as VM parameter. Web app firsts instantiates log4j2, and then tries to config log4j2 again, throwing the following error due to double clas

Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Chris, my web app META-INF/lib has log4j jar, but CATALINA_BASE/lib does not have log4j jar listed. It should be double loading class issue. I need to find out how to exclude the unwanted classloading. -aj On Thu, May 7, 2020 at 2:48 PM Christopher Schultz < ch...@christopherschultz.net> wrot

Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Luis, good blog for logging settings. thanks. -aj On Thu, May 7, 2020 at 11:42 PM Luis Rodríguez Fernández wrote: > Hello AjChen, > > Here [1] you can find an example of how I configured log4j2 in tomcat 9. > You can skip all the bla, bla, bla and go directly to the gitthub repo [2] > and ru

Re: log4j failed on tomcat9

2020-05-07 Thread Luis Rodríguez Fernández
Hello AjChen, Here [1] you can find an example of how I configured log4j2 in tomcat 9. You can skip all the bla, bla, bla and go directly to the gitthub repo [2] and run the example to have a look at the configuration. Note: I've been running like this for a while in production, but I do think th

Re: log4j failed on tomcat9

2020-05-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 AJ, On 5/7/20 16:40, AJ Chen wrote: > I use eclipse to develop web app for tomcat, Web app has a > dependent project and so the dependent project and all jars are > added on the classpath for tomcat runtime. Log4j works on tomcat 6. > But after upgr

Re: log4j failed on tomcat9

2020-05-07 Thread Mark Thomas
On 07/05/2020 21:40, AJ Chen wrote: > I use eclipse to develop web app for tomcat, Web app has a dependent > project and so the dependent project and all jars are added on the > classpath for tomcat runtime. Log4j works on tomcat 6. But after upgrate to > tomcat 9, log4j failed to start with the fo