yoavs 2004/09/07 07:32:50 Modified: docs/faq misc.html docs/faq/printer misc.html xdocs-faq misc.xml project.xml Added: xdocs-faq logging.xml Log: Added separate logging section Revision Changes Path 1.26 +2 -11 jakarta-tomcat-site/docs/faq/misc.html Index: misc.html =================================================================== RCS file: /home/cvs/jakarta-tomcat-site/docs/faq/misc.html,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- misc.html 31 Aug 2004 15:35:23 -0000 1.25 +++ misc.html 7 Sep 2004 14:32:50 -0000 1.26 @@ -678,16 +678,7 @@ </a> </b> <div style="padding-left : 20px;"> - <code>System.out</code> and <code>System.err</code> both print to - catalina.out. But you can suppress this via the swallowOutput property and - sent to different log files. - <br> - catalina.out does not rotate. But it should not be an issue because - nothing should be printing to standard output since you are using a logging - package, right? - <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=106623436423859&w=2"> A log4j example</a> and - <a href="http://marc.theaimsgroup.com/?t=105544472600001&r=1&w=2">a thread about rotation of catalina.out</a> - + See <a href="logging.html">the Logging section of the FAQ.</a> </div><br> <b style="font-size: larger"> @@ -769,7 +760,7 @@ </a> </b> <div style="padding-left : 20px;"> - See this mailing list <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108330970225012&w=2">message.</a> For an example with log4j and tomcat running with JSVC (port 80), see <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108578233003073&w=2">this thread.</a> + See <a href="logging.html">the Logging section of the FAQ.</a> </div><br> </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade=""></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font size="-1" color="#525D76"><em> Copyright © 1999-2003, Apache Software Foundation 1.23 +2 -11 jakarta-tomcat-site/docs/faq/printer/misc.html Index: misc.html =================================================================== RCS file: /home/cvs/jakarta-tomcat-site/docs/faq/printer/misc.html,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- misc.html 31 Aug 2004 15:35:23 -0000 1.22 +++ misc.html 7 Sep 2004 14:32:50 -0000 1.23 @@ -677,16 +677,7 @@ </a> </b> <div style="padding-left : 20px;"> - <code>System.out</code> and <code>System.err</code> both print to - catalina.out. But you can suppress this via the swallowOutput property and - sent to different log files. - <br> - catalina.out does not rotate. But it should not be an issue because - nothing should be printing to standard output since you are using a logging - package, right? - <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=106623436423859&w=2"> A log4j example</a> and - <a href="http://marc.theaimsgroup.com/?t=105544472600001&r=1&w=2">a thread about rotation of catalina.out</a> - + See <a href="logging.html">the Logging section of the FAQ.</a> </div><br> <b style="font-size: larger"> @@ -768,7 +759,7 @@ </a> </b> <div style="padding-left : 20px;"> - See this mailing list <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108330970225012&w=2">message.</a> For an example with log4j and tomcat running with JSVC (port 80), see <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108578233003073&w=2">this thread.</a> + See <a href="logging.html">the Logging section of the FAQ.</a> </div><br> </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade=""></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font size="-1" color="#525D76"><em> Copyright © 1999-2003, Apache Software Foundation 1.22 +2 -11 jakarta-tomcat-site/xdocs-faq/misc.xml Index: misc.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-site/xdocs-faq/misc.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- misc.xml 31 Aug 2004 15:35:23 -0000 1.21 +++ misc.xml 7 Sep 2004 14:32:50 -0000 1.22 @@ -694,16 +694,7 @@ </a> </question> <answer> - <code>System.out</code> and <code>System.err</code> both print to - catalina.out. But you can suppress this via the swallowOutput property and - sent to different log files. - <br/> - catalina.out does not rotate. But it should not be an issue because - nothing should be printing to standard output since you are using a logging - package, right? - <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=106623436423859&w=2"> A log4j example</a> and - <a href="http://marc.theaimsgroup.com/?t=105544472600001&r=1&w=2">a thread about rotation of catalina.out</a> - + See <a href="logging.html">the Logging section of the FAQ.</a> </answer> <question> @@ -785,7 +776,7 @@ </a> </question> <answer> - See this mailing list <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108330970225012&w=2">message.</a> For an example with log4j and tomcat running with JSVC (port 80), see <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108578233003073&w=2">this thread.</a> + See <a href="logging.html">the Logging section of the FAQ.</a> </answer> </section> 1.6 +1 -0 jakarta-tomcat-site/xdocs-faq/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-site/xdocs-faq/project.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- project.xml 2 Aug 2004 14:59:35 -0000 1.5 +++ project.xml 7 Sep 2004 14:32:50 -0000 1.6 @@ -24,6 +24,7 @@ <item name="Deployment" href="deployment.html" /> <item name="How do I" href="http://nagoya.apache.org/wiki/apachewiki.cgi?Tomcat/Howto"/> <item name="Linux / Unix" href="unix.html"/> + <item name="Logging" href="logging.html" /> <item name="OS/2, z/OS" href="os2.html"/> <item name="Memory" href="memory.html"/> <item name="Meta" href="meta.html"/> 1.1 jakarta-tomcat-site/xdocs-faq/logging.xml Index: logging.xml =================================================================== <?xml version="1.0"?> <!DOCTYPE document [ <!ENTITY project SYSTEM "project.xml"> ]> <document url="security.html"> &project; <properties> <author email="[EMAIL PROTECTED]">Tim Funk</author> <author email="[EMAIL PROTECTED]">Yoav Shapira</author> <title>Logging</title> </properties> <body> <section name="Preface"> <p> This FAQ section provides help with logging-related issues. </p> </section> <section name="Questions"> <ul> <li> <a href="#builtIn"> Does Tomcat have built-in logging capabilities, and if so how do I use them? </a> </li> <li> <a href="#commonsLoggingConfiguration"> How do I configure commons-logging for use with Tomcat? </a> </li> <li> <a href="#userWebapps"> How should I log in my own webapps? </a> </li> <li> <a href="#catalina.out"> Where does System.out go? <br /> How do I rotate catalina.out? </a> </li> <li> <a href="#windowsService"> Where are the logs when running Tomcat as a Windows service? </a> </li> <li> <a href="#externalDocs"> Are there external documents, tutorials, or references about logging in Tomcat? </a> </li> </ul> </section> <section name="Answers"> <question> <a name="builtIn"> Does Tomcat have built-in logging capabilities, and if so how do I use them? </a> </question> <answer> The Servlet Specification requires Servlet Containers like Tomcat to provide at least a rudimentary implementation of the ServletContext#log method. Tomcat provides a much richer implementation than required by the Spec, as follows: <ul> <li>Prior to Tomcat 5.5, Tomcat provided a <code>Logger</code> element that you could configure and extend according to your needs. If you are using a Tomcat version previous to Tomcat 5.5, make sure to read <a href="http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/logger.html"> the Logger configuration reference.</a></li> <li>Starting with Tomcat 5.5, <code>Logger</code> was removed and <a href="http://jakarta.apache.org/commons/logging">Jakarta Commons-Logging</a> <code>Log</code> is used everywhere in Tomcat. Read the Commons-Logging documentation if you'd like to know how to better use and configure Tomcat's internal logging.</li> </ul> In addition, Tomcat does not swallow the <code>System.out</code> and <code>System.err</code> JVM output streams. You may use these streams for elementary logging if you wish, but a more robust approach such as commons-logging or <a href="http://logging.apache.org/log4j">Log4J</a> is recommended for production applications. </answer> <question> <a name="commonsLoggingConfiguration"> How do I configure commons-logging for use with Tomcat? </a> </question> <answer> You need to specify a commons-logging configuration file and, if you wish, a logging implementation that supports commons-logging. JDK 1.4 (and later) java.util.Logging and <a href="http://logging.apache.org/log4j">Log4j</a> are the two most commonly used logging toolkits for Tomcat. If you supply an external logging toolkit such as Log4J, it needs to be located in the $CATALINA_HOME/common/lib directory (for Tomcat 5.0 and earlier) or added to the bootstrap classpath by using the scripts in $CATALINA_HOME/bin (this is required for Tomcat 5.5 and later, which uses commons-logging while bootstrapping, and optional for Tomcat 5.0 and earlier). <br/><br/> For more detailed instructions, see these mailing list discussions: <ul> <li> <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=106623436423859&w=2">A log4j example</a> </li> <li> <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108330970225012&w=2">Logging Configuration</a> </li> <li> <a href="http://marc.theaimsgroup.com/?l=tomcat-user&m=108578233003073&w=2">Example with JSVC and running on port 80.</a> </li> <li> <a href="http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&by=thread&from=877025">Need for it to be in bootstrap classpath.</a> </li> </ul> </answer> <question> <a name="userWebapps"> How should I log in my own webapps? </a> </question> <answer> While you can use <code>System.out</code> and <code>System.err</code> to log, we strongly recommend using a toolkit like <a href="http://logging.apache.org/log4j">Log4J</a> or JDK 1.4's <code>java.util.logging</code> package. With these toolkits, you have significantly more functionality (for example, sending emails, logging to a database, controlling at runtime the logging level of different classes, inspecting the logs with a graphical viewer, etc.) than with Tomcat's built-in default logging configuration. <p /> We also recommend that you separate your logging from Tomcat's internal logging. That means you should bundle your logging toolkit with your webapp. If you're using Log4J, for example, place the Log4J jar in the WEB-INF/lib directory of your webapp and the Log4J configuration file in the WEB-INF/classes directory of your webapp. This way different web applications can have different logging configurations and you don't need to worry about them interfering with each other. </answer> <question> <a name="catalina.out"> Where does System.out go? <br /> How do I rotate catalina.out? </a> </question> <answer> <code>System.out</code> and <code>System.err</code> both print to catalina.out. But you can suppress this via the swallowOutput property and sent to different log files. <br/> catalina.out does not rotate. But it should not be an issue because nothing should be printing to standard output since you are using a logging package, right? <a href="http://marc.theaimsgroup.com/?t=105544472600001&r=1&w=2">a thread about rotation of catalina.out</a> </answer> <question> <a name="windowsService"> Where are the logs when running Tomcat as a Windows service? </a> </question> <answer> See these mailing list archive threads: <ul> <li> <a href="http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&by=thread&from=863525">Where are the Tomcat logs when running as a Windows service?</a> </li> </ul> </answer> <question> <a name="externalDocs"> Are there external documents, tutorials, or references about logging in Tomcat? </a> </question> <answer> Yes, there are. You can Google for more, but some such references are: <ul> <li> <a href="http://minaret.biz/tips/tomcatLogging.html">Tomcat 5.0.27, Velocity 1.4, Log4j</a> </li> </ul> </answer> </section> </body> </document>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]