tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "EXT-Patel, Rajesh M" <rajesh.m.pa...@boeing.com>
Subject RE: Web App stdout interception
Date Wed, 28 Apr 2004 23:33:03 GMT
I dropped this into a JSP to test my theory, looks
like it is indeed separating the logging based on the
thread:
<% System.out.println("system.out on request thread");
  new Thread(new Runnable() {
    public void run() {
	System.out.println("system.out on separate thread");
    }
  }).start();

%>

Raj

>  -----Original Message-----
> From: 	EXT-Patel, Rajesh M  
> Sent:	Wednesday, April 28, 2004 6:16 PM
> To:	'tomcat-user@jakarta.apache.org'
> Subject:	Web App stdout interception
> 
> In the following(see end of email) context I have "swallowOutput=true" and then I defined
a FileLogger.
> I am using log4j in my webapp, we are dumping everything to standard out.  However
> I noticed that STDOUT is not being redirected.  I even did a System.out to prove
> that, it still goes to the containers' stdout.log file.  
> 
> Does anyone know if this works?  I'm also interested in how it works!  The only
> way I can think of would be to replace System.out and watch the threads
> that come in.  Tomcat know which request thread is "in" the webapp so it
> can redirect it to the proper log file.
> 
> Anyways, here is my context definition:
> 
> 
> 	<Context className="org.apache.catalina.core.StandardContext" 
> 	         cachingAllowed="true" 
> 	         charsetMapperClass="org.apache.catalina.util.CharsetMapper" 
> 	         cookies="true" 
> 	         crossContext="false" 
> 	         debug="9" 
> 		 docBase="d:/appsRoot/apps/BestPractices" 
> 	         mapperClass="org.apache.catalina.core.StandardContextMapper" 
> 		 path="/apps/BestPractices" 
> 	         privileged="false" 
> 	         reloadable="true" 
> 	         swallowOutput="true" 
> 	         useNaming="true" 
> 	         wrapperClass="org.apache.catalina.core.StandardWrapper">
> 
> 	  <Logger className="org.apache.catalina.logger.FileLogger"
> 		  prefix="BestPractices_log." 
> 	          suffix=".txt"
> 	          timestamp="true"
> 	          verbosity="9" />
> 	          
> 
> 	  <Manager className="org.apache.catalina.session.PersistentManager"
> 	      debug="0"
> 	      saveOnRestart="false">
> 	  </Manager>
> 	</Context>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message