tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject logging question
Date Fri, 10 Sep 2010 15:38:57 GMT
Hi.

Under tomcat 5.5, a foreign webapp writes to STDOUT and STDERR, clogging up one of the 
system logfiles (/var/log/daemon.log).

The tomcat5.5 startup script on this platform runs it under jsvc, and seems to redirect 
all its STDOUT and STDERR to the syslog facility, which I suppose directs it to daemon.log.

I'd like to find out how I could catch the STDOUT and STDERR of this webapp specifically 
(or otherwise of the corresponding <Host>), to redirect them to some other logfile which
I 
could rotate or zap separately.

Can someone help ?

Data :

Platform : Linux Debian 2.6.26-2-686
Tomcat :
Using CATALINA_BASE:   /usr/share/tomcat5.5
Using CATALINA_HOME:   /usr/share/tomcat5.5
Using CATALINA_TMPDIR: /usr/share/tomcat5.5/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun
Server version: Apache Tomcat/5.5
Server built:   Oct 15 2008 12:57:44
Server number:  5.5.26.0
OS Name:        Linux
OS Version:     2.6.26-2-686
Architecture:   i386
JVM Version:    1.6.0_20-b02
JVM Vendor:     Sun Microsystems Inc.
vovm3:/usr/share/tomcat5.5/bin#

command starting tomcat 5.5 :
/etc/init.d/tomcat5.5 which contains this stanza :


		$DAEMON -user "$TOMCAT5_USER" -cp "$JSVC_CLASSPATH" \
		    -outfile SYSLOG -errfile SYSLOG \
		    -pidfile "$CATALINA_PID" $JAVA_OPTS "$BOOTSTRAP_CLASS"

which results in this running tomcat process :

root      2753  2752  0 Aug29 ?        00:00:00 /usr/bin/jsvc -user tomcat55 -cp 
/usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar -outfile SYSLOG

-errfile SYSLOG -pidfile /var/run/tomcat5.5.pid -Djava.awt.headless=true -Xms128M -Xmx128M

-Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed 
-Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5 
-Djava.io.tmpdir=/var/lib/tomcat5.5/temp 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties 
org.apache.catalina.startup.Bootstrap

/var/lib/tomcat5.5/conf/logging.properties currently contains :

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler,

3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, 
5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.

4admin.org.apache.juli.FileHandler.level = FINE
4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4admin.org.apache.juli.FileHandler.prefix = admin.

5host-manager.org.apache.juli.FileHandler.level = FINE
5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5host-manager.org.apache.juli.FileHandler.prefix = host-manager.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 
2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 
3manager.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handlers = 
4admin.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 
5host-manager.org.apache.juli.FileHandler



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


Mime
View raw message