tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: logging question
Date Mon, 15 Nov 2004 15:25:13 GMT

Just adding a Logger is not enough to redirect System.out.println calls
to it.  You need to add swallowOutput="true" to your Context definition.
Or alternatively change the code from using System.out.println to using

Yoav Shapira

>-----Original Message-----
>From: Scott Pippin []
>Sent: Monday, November 15, 2004 10:20 AM
>Subject: logging question
>I am trying to send the return values/errors for an application to a
>different stdout file.  I set up everything but stdout is being
>to catalina.out.
> <Server port="8005" shutdown="SHUTDOWN" debug="0">
>   <Listener
>   <Listener
>debug="0" />
>   <Environment name="simpleValue" type="java.lang.Integer" value="30"
>   <Resource name="UserDatabase" auth="Container"
>type="org.apache.catalina.UserDatabase" description="User database
>can be updated and saved" />
>  <ResourceParams name="UserDatabase">
>   <parameter>
>   <name>factory</name>
>   <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>   </parameter>
>   <parameter>
>   <name>pathname</name>
>   <value>conf/tomcat-users.xml</value>
>   </parameter>
>   </ResourceParams>
>   </GlobalNamingResources>
>  <Service name="Catalina">
>    <Connector port="8080" maxThreads="150" minSpareThreads="25"
>maxSpareThreads="75" enableLookups="false" redirectPort="8443"
>acceptCount="100" debug="0" connectionTimeout="20000"
>disableUploadTimeout="true" />
>    <Connector port="8009" enableLookups="false" redirectPort="8443"
>debug="0" protocol="AJP/1.3" />
>     <Engine name="Catalina" defaultHost="localhost" debug="0">
>     <Logger className="org.apache.catalina.logger.FileLogger"
>prefix="catalina_log." suffix=".txt" timestamp="true" />
>      <Realm className="org.apache.catalina.realm.JDBCRealm"
>connectionName="ims" connectionPassword="ims"
>driverName="com.mysql.jdbc.Driver" userTable="imsuser"
>userNameCol="userid" userCredCol="passwordid" userRoleTable="imsrole"
>roleNameCol="userrole" />
>      <Host name="localhost" debug="0" appBase="webapps"
>unpackWARs="true" autoDeploy="true" xmlValidation="false"
>      <Logger className="org.apache.catalina.logger.FileLogger"
>                   directory="logs"  prefix="localhost_log."
>                timestamp="true"/>
>       </Host>
>     </Engine>
>   </Service>
>  </Server>
>context.xml under the application/web-INF directory
><?xml version="1.0" encoding="utf-8" ?>
><Context path="/IMS" reloadable="true" docBase="IMS" debug="4">
>   <Logger className="org.apache.catalina.logger.FileLogger"
>prefix="ims_log." suffix=".txt" timestamp="true" verbosity="4" />
>   <Logger className="org.apache.catalina.logger.SystemErrLogger"
>prefix="ims_err." suffix=".txt" timestamp="true" verbosity="4" />
>   <Logger className="org.apache.catalina.logger.SystemOutLogger"
>prefix="ims_out." suffix=".txt" timestamp="true" verbosity="4" />
>Tomcat 5.0.28/Apache2
>Have I missed something?
>Scott Pippin

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message