You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Koes, Derrick" <De...@Smith-Nephew.com> on 2002/07/31 14:39:59 UTC

log4j in tomcat

If I start Tomcat as an NT service I get the WARNings that no log4j
appenders could be found.

If I start Tomcat from the start menu everything works as expected and I get
my logs.

 

Has anyone seen this behavior?

Is there an explanation?  I'm guessing some kind of timing issue.


RE: log4j in tomcat

Posted by "Charles N. Harvey III" <ch...@alloy.com>.
I think I know what the problem is.  To add log4j to Tomcat you added an
extra parameter to either startup.bat or catalina.bat right?  (I can't
remember which one.)  So when you start Tomcat from the start menu it
reads the change you made in the file.

Thing is, when Tomcat starts as a service it DOES NOT read that change
that you made.  Doh!  Here's why.  The installer creates the service like
any other service gets made - with the command prompt.  That's what the
tomcat.exe file is for in your /bin directory.  It does not run Tomcat,
it installs it as a service.  But, it installs with the same set of
parameters
as in the original (catalina|startup).bat file.

So what has to be done is that you must remove the Tomcat service and
re-install it all from the command prompt.  And here is a link to a web
page made by some really nice people that know more about it than me.

http://www.alexandriasc.com/software/JavaService/index.html

They have made a seperate file called JavaService.exe to run the command
against instead of Tomcat.exe.  The documentation page on that site explains
how to install everything and all the parameters you can set.

The only thing not explained is how to remove the Tomcat Service.
	> Tomcat.exe -uninstall "Service Name"
(Enter the exact name, with spaces, that you see in the services menu.

The command you enter will look something like this - take note of the log4j
part:

 > "%CATALINA_HOME%\bin\tomcat.exe" -install "Apache Tomcat"
"%JAVA_HOME%\jre\bin\hotspot\jvm.dll"
-Dlog4j.configuration=/WEB-INF/conf/log4j.properties
-Djava.class.path="%CATALINA_START%" -Dcatalina.home="%CATALINA_HOME%" -Xrs
-start org.apache.catalina.startup.Bootstrap -params start
-stop org.apache.catalina.startup.Bootstrap -params stop
-out "%CATALINA_HOME%"\logs\stderr.log

Yeah, long.  But if you look at your (startup|catalina).bat file it will
look
similar.

Hope this answers your questions - I know my answers are long winded.

Charlie



> -----Original Message-----
> From: Koes, Derrick [mailto:Derrick.Koes@Smith-Nephew.com]
> Sent: Wednesday, July 31, 2002 8:40 AM
> To: 'Tomcat Users List'
> Subject: log4j in tomcat
>
>
> If I start Tomcat as an NT service I get the WARNings that no log4j
> appenders could be found.
>
> If I start Tomcat from the start menu everything works as
> expected and I get
> my logs.
>
>
>
> Has anyone seen this behavior?
>
> Is there an explanation?  I'm guessing some kind of timing issue.
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>