tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Tomcat Wiki] Update of "HowTo" by KonstantinKolinko
Date Sat, 02 Feb 2013 20:56:01 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification.

The "HowTo" page has been changed by KonstantinKolinko:

Remove "How do I use log4j for all Tomcat log output?" entry. The text was old and wrong.
This topic is covered by Tomcat docs.

  No.  If you can edit Tomcat's startup scripts (or better create a {{{}}} file),
you can add "-D" options to Java.  But there is no way in Java to have different values of
system properties for different classes in the same JVM.
  There are some other methods available, like using {{{ServletContext.getContextPath()}}}
to get the context name of your web application and locate some resources accordingly, or
to define {{{<context-param>}}} elements in {{{WEB-INF/web.xml}}} file of your web application
and then set the values for them in Tomcat context file ({{{META-INF/context.xml}}}). See .
- == How do I use log4j for all Tomcat log output? ==
- To have Tomcat use log4j universally, place both `log4j.jar` and the Jakarta `commons-logging.jar`
into the `$TOMCAT_HOME/common/lib` directory.  Create your log4j properties file as `$TOMCAT_HOME/common/classes/`
and configure the root logger.  Here is the basic `` that I used to do this
- {{{
- log4j.rootLogger=info, R
- log4j.appender.R=org.apache.log4j.ConsoleAppender
- log4j.appender.R.layout=org.apache.log4j.PatternLayout
- log4j.appender.R.layout.ConversionPattern=%-5p %-30.30c{1} %x - %m%n
- }}}
- If you only need to use log4j in your own web app, just include log4j (and any log4j properties
file) in your WAR file.
  == How do I configure Tomcat Connectors? ==
  On the Tomcat FAQ, there is a list of Other Resources which should have information pointing
you to the relevant pages.

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

View raw message