× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Alex Pinsky wrote:
Hi,
We are in a process of upgrading from Tomcat3.2.2 to Tomcat4.1.27. I have a question about logging in Tomcat. I configured server.xml to point context logging to specific file name in logs directory something like:
<Context path="/mydir" docBase="mydir" debug="0"
reloadable="false" crossContext="false">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="mydir_log." suffix=".txt" logVerbosityLevel="WARNING"
timestamp="true"/> </Context>
I want my System.out.println messages printed from this context go to this file, but it is not the case, they go to general catalina.out.
> Also does anybody knows how to stop [INFO] level messages being posted to catalina.out

Tomcat redirects System.out and System.err (see catalina.sh):
..
org.apache.catalina.startup.Bootstrap "$@" start \
  >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
..

It really depends how these messages are generated.
If you are using System.out.println I think the only way is to set System.out within your webapp:
System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream("yourfilename"))));


But if if you're using a logger .. well, configure it accordingly ;-)

Alex Pinsky

Chrisian



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.