On Wed, Dec 19, 2018 at 06:52:20PM +0000, Lemke, Michael ST/HZA-ZIC2 wrote: > On December 19, 2018 6:54 PM Lemke, Michael wrote: > >On December 18, 2018 8:52 PM Christopher Schultz wrote: > >>On 12/18/18 12:42, Lemke, Michael ST/HZA-ZIC2 wrote: > >>> I have an old webapp that uses log4j 1.2 and which I am trying to > >>> deploy on tomcat. For the heck of it I can't get tomcat to use the > >>> log4.properties file. What am I doing wrong? > >> > >> > >>How are you initializing log4j? > > > >Good question. I just dug a little and have to say I don't know. It > >is a myfaces 1.1 application and I just realized jsf has logging built > >in somehow. I can't find any explicit call to Logger.getLogger in the > >code. > > > >I guess I have a terrible mess of all sorts of loggers in my libraries. I am > >not good at all the different Java loggers. The log4j.properties I want > >to use is for log4j-1.2.27 so not quite bleeding edge ??. Then there are > >other libs that pull in slf4j-api-1.7.25.jar, there is a > >jcl-over-slf4j-1.7.25.jar, > >logback-classic-1.2.3.jar, logback-core-1.2.3.jar. > > > >Well, I do get quite lot of logging from the app in the tomcat logfiles, so > >something is working. But I don't know how to configure it. > > > >This used to work when I ran it on resin but I also changed quite a bit on > >the code when I switched to tomcat. I'll try without all the new stuff. > > And this was it. The old version without the stuff that pulls in all the other > log libraries it works. So tomcat is out of the loop. Sorry for the noise. > (But if someone has a hint on my mess I wouldn't mind.)
If this happens to be a project built with Maven then 'mvn dependency:tree' should tell you which artifacts are pulling in SLF4J. You may need to run this more than once as you comb out transitive dependencies one by one. But it's possible to use multiple logging frameworks in one webapp. if you include/exclude the right artifacts. See https://www.slf4j.org/legacy.html if you need to do this with SLF4J and Log4J v1. -- Mark H. Wood Lead Technology Analyst University Library Indiana University - Purdue University Indianapolis 755 W. Michigan Street Indianapolis, IN 46202 317-274-0749 www.ulib.iupui.edu
signature.asc
Description: PGP signature