Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enable Logging in Tomcat

 
rini john
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Tomcat 5.0 version, i am not able to activate logging information.

i have done the following configuration in server.xml then also logs are not generated.

<Valve className="org.apache.catalina.valves.AccessLogValve"

* directory="logs" prefix="localhost_access_log." suffix=".log"

pattern="common" resolveHosts="false"/>

Kindly help....!!!1

Regards,
Rini John
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where exactly did you do the change in server.xml ?

Why do you have an asterisk in



 
rini john
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside the host tag, details of which are given below

<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Valve className="org.apache.catalina.valves.AccessLogValve"

directory="logs" prefix="localhost_access_log." suffix=".log"

pattern="common" resolveHosts="false"/>

<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="log_whatever-access." suffix=".txt"
timestamp="true"/>

</Host>

the asterik sign was mistakenly given....

Is there any difference in configuration done for logging in Tomcat 5.0 or later one's.

Regards,
Rini John
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should work. May be you have the permissions issues with "logs" directory. What does regular log say?
 
rini john
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no log is generated.....
 
rini john
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Tomcat 5.0 for logging is there need to keep log4j.jar in lib folder of CATALINA_HOME?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rini john wrote:In Tomcat 5.0 for logging is there need to keep log4j.jar in lib folder of CATALINA_HOME?


No, and you're probably safer not to do so. Please note that logging for webapps and logging for Tomcat itself are 2 entirely different things, though. The Tomcat docs on logging refer to how Tomcat logs itself. Webapps are responsible for their own logging.

Tomcat 5.0 is really obsolete now. You should consider moving to Tomcat 5.5.28 or Tomcat6.
 
Rushikesh Pisal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

i m using tomcat 5.0 currently n i want disable log of tomcat because it prints below message on my console.
i want to remove below message from my console

Mar 28, 2011 4:03:12 PM org.apache.catalina.startup.Embedded start
INFO: Starting tomcat server
Mar 28, 2011 4:03:13 PM org.apache.catalina.core.StandardEngine start

INFO: Starting Servlet Engine: Apache Tomcat/5.0.28
Mar 28, 2011 4:03:13 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 28, 2011 4:03:15 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-192.195.172.168-3048
Mar 28, 2011 4:03:15 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-192.195.172.168-3048
Mar 28, 2011 4:03:15 PM org.apache.catalina.core.StandardHost getDepl

INFO: Create Host deployer for direct deployment ( non-jmx )
Mar 28, 2011 4:03:15 PM org.apache.catalina.core.StandardHostDeployer
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rushikesh Pisal wrote:Hello,

i m using tomcat 5.0 currently n i want disable log of tomcat because it prints below message on my console.
i want to remove below message from my console

Mar 28, 2011 4:03:12 PM org.apache.catalina.startup.Embedded start
INFO: Starting tomcat server
Mar 28, 2011 4:03:13 PM org.apache.catalina.core.StandardEngine start

INFO: Starting Servlet Engine: Apache Tomcat/5.0.28
Mar 28, 2011 4:03:13 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 28, 2011 4:03:15 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-192.195.172.168-3048
Mar 28, 2011 4:03:15 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-192.195.172.168-3048
Mar 28, 2011 4:03:15 PM org.apache.catalina.core.StandardHost getDepl

INFO: Create Host deployer for direct deployment ( non-jmx )
Mar 28, 2011 4:03:15 PM org.apache.catalina.core.StandardHostDeployer


Please don't post questions multiple times. It confuses people. You asked this as a stand-alone question, and that's where I hope people will go to answer it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic