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 
>> file. What am I doing wrong?
>Are you trying to get Tomcat to use the file from
>your application? 

No, this is not what I want to do.

>If so, that's not going to work, because Tomcagt
>starts up long before your application is loaded, and so the log4j.jar
>file and file are not used at all.
>Your *application* should be able to use log4j without any problems as
>long as the log4j.jar file is in WEB-INB/lib and your
>file is in (usually) WEB-INF/classes/

Right, I want my application to use its

>> tomcat 9.0.6 is installed as a Windows service and does serve my 
>> webapp, so the app is working fine. The project is mavenized, I
>> put to src/main/resources and it ends up in the jar
>> file of my application. Is there anything special that needs to be
>> done?
>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 

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 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 
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.


To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to