TomcatExpert

How to redirect stderr and stdout messages

posted by SpringSource on December 28, 2009 06:05 PM

How to configure your web application's stderr and stdout messages be redirected to the application's log file for Tomcat 5.5 in ERS 3.x

For standard web applications, error messages and output are streamed to log files using sterr and stdout respectively. Some application developers prefer to aggregate all these messages into the application log.

The following steps are required to configure your web application's stderr and stdout messages be redirected to the application's log file for Tomcat 5.5 in ERS 3.1 utilizing java.util.logging:

 

1. Add the following attribute to the application context in <ERS3.1_install_dir>/servers/<server_instance>/conf/context.xml file:

swallowOutput="true" 

2. Create <ERS3.1_install_dir>/servers/<server_instance>/webapps//WEB-INF/classes/logging.properties with the following content:

handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler 
############################################################ 
# Handler specific properties. 
# Describes specific configuration info for Handlers. 
############################################################
org.apache.juli.FileHandler.level = FINE 
org.apache.juli.FileHandler.directory = /servers//logs 
org.apache.juli.FileHandler.prefix = jsp-examples. 
 
java.util.logging.ConsoleHandler.level = FINE 
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 

NOTE: In the above example, the application log file with prefix jsp-examples. will be created in the server instance's logs directory.

 

3. To test the configuration, create a JSP page with the following content:

<% 
System.out.println("Test stdout"); 
System.err.println("Test stderr"); 
%> 

The stderr and stdout would continue to be logged in jvm.stdout, they are also logged in the application's log file.

 

 

For more than 10 years, SpringSource employees have been supporting Apache technologies, with unparalleled experience and commitment to the Apache Software Foundation. More than 400 of the Fortune 500 count on SpringSource to support their mission-critical business applications. Leaders of the Apache Software Foundation, including Board Members, work at SpringSource and dedicate a significant amount of time further developing the Apache Tomcat open source project. Over the last 2 years, 95% of the issues fixed in the Apache Tomcat project were fixed by SpringSource engineers. For more information on how SpringSource can help your enterprise, see the SpringSource website, or call 800/444-1935.

Comments

rfc

Can you please clarify if this /servers/ refers to a tomcat directory?
thanks

Wonderful

I am still unsure about whether “org.apache.juli.FileHandler.directory = /servers//logs” and “org.apache.juli.FileHandler.prefix = jsp-examples.“ would work well. I shall try it myself and see If it does and would recommend it for others. I think I should take a backup of what I have now before I attempt something like this. kosher restaurants la

buy twitter followers I am a

buy twitter followers I am a new user of this site so here i saw multiple articles and posts posted by this site,I curious more interest in some of them hope you will give more information on this topics in your next articles. youtube buying views

asdfsfd

Thanks for showing this awesome post APP download

and click and click and click and click

and click

trucos hungry shark

trucos hungry shark evolution I have a similar interest this is my page read everything carefully and let me know what you think. clash of clans cheats deutsch android

redirect the stdrr messages to stout messages

The provided information is really helpful me to solve my problems. This is the post which I really looking for. Your essaycenter essay writing was help me to redirect the stdrr messages to stout messages. I appreciate for you that your way of explanation which is really good. Keep posting the information like this.

SEO promotion companies

SEO promotion companies depend on keyword and key phrase vividness - an often complicated algorithm that checks to see how many of search phrases are being study by Search search engines Birthday Gift Registry.

what an amazing article.

what an amazing article.
لعبة
اقاريو
لعبة المزرعة السعيدة

DSASDASD

jimmy choo
the north face outlet
red valentino
michael kors
louis vuitton sacs564SW
cheap jordan shoes
rolex replica watches
michael kors handbags outlet
ed hardy
jordan shoes
cheap jordans
nike blazer
ralph lauren pas cher
adidas nmd
gucci borse
fitflops shoes
nike outlet store
michael kors handbags online
nike free 5
nike roshe
converse trainers
true religion jeans sale
adidas nmd
omega watches for sale
michael kors handbags wholesale
michael kors handbags
cheap basketball shoes
longchamps
michael kors outlet
michael kors handbags wholesale
cheap nfl jerseys wholesale
instyler max 2
nike huarache trainers
ed hardy outlet
pandora charms
michael kors handbags sale
tiffany and co outlet
lebron shoes
longchamp le pliage
skechers outlet
lebron james shoes
abercrombie and fitch
michael kors handbags
michael kors handbags
michael kors handbags
nike store uk
asics shoes
pandora jewelry
michael kors handbags
nike huarache
cheap mlb jerseys
cheap ray ban sunglasses
cheap nhl jerseys
jimmy choo shoes
nike store
michael kors outlet store
nike tn
michael kors outlet
michael kors outlet
toms shoes
cheap nike shoes
michael kors handbags
michael kors outlet
yeezy boost 350 black
michael kors handbags
michael kors handbags
polo ralph lauren
toms outlet
sac longchamp
fitflops sale clearance
michael kors uk
mlb jerseys
kobe 9
michael kors uk
nike air max 90
christian louboutin outlet
cheap michael kors handbags
nike blazer pas cher
cheap michael kors handbags
saics running shoes
ecco shoes outlet
ralph lauren outlet online
michael kors handbags
nike outlet
nike trainers uk
ghd hair straighteners
new balance outlet
hugo boss outlet
supra shoes
nba jerseys
nike air huarache
ralph lauren outlet
polo ralph lauren outlet
nike blazer low
michael kors outlet store
nike trainers uk
hugo boss sale
armani exchange
fitflops
air jordan uk
cheap jordans
michael kors handbags
tiffany and co
supra shoes sale
michael kors handbags
dolce and gabbana
cheap nike shoes sale
new balance shoes
nike air force 1
michael kors handbags wholesale
omega watches
nike trainers
gucci sito ufficiale
michael kors outlet online
salomon boots
armani exchange outlet
michael kors handbags
yeezy boost 350
christian louboutin shoes
nike huarache
instyler max
nike tn pas cher
valentino shoes
nike trainers
ed hardy clothing
under armour outlet
michael kors handbags
fitflops sale clearance
nike free
michael kors handbags
michael kors handbags
cheap oakley sunglasses
oakley sunglasses
salomon shoes
cheap oakley sunglasses
oakley sunglasses
ghd flat iron
michael kors handbags
the north face
chaussure louboutin
cheap oakley sunglasses
michael kors handbags
pandora outlet
michael kors handbags
salvatore ferragamo
moncler outlet
converse shoes
nike blazer pas cher
true religion jeans
adidas nmd r1
louis vuitton pas cher
ray ban sunglasses
jordan shoes
mont blanc pens
michael kors handbags wholesale
replica watches
ecco shoes
ralph lauren
ray ban sunglasses
michael kors handbags outlet
abercrombie and fitch kids
michael kors handbags clearance
cheap ray bans
longchamp bags
oakley sunglasses
versace
ed hardy uk
pandora jewelry
mont blanc pens outlet
cheap nfl jerseys
michael kors outlet
dolce and gabbana shoes
basketball shoes
nike huarache
michael kors outlet
nike air huarache
michael kors outlet
versace shoes
air force 1 shoes
cheap michael kors handbags
michael kors handbags outlet
michael kors outlet
cheap nba jerseys
under armour shoes
ferragamo shoes
adidas nmd runner
michael kors handbags
nike blazer
reebok shoes
michael kors handbags wholesale
skechers shoes
chaussure louboutin pas cher
dolce and gabbana outlet
michael kors handbags
michael kors outlet online
cheap michael kors handbags
birkenstock sandals
air max 90
michael kors outlet clearance
birkenstocks
nike roshe run
yeezy boost 350 white
reebok outlet
moncler jackets
michael kors handbags sale
kobe 9 elite
nhl jerseys
michael kors handbags
michael kors outlet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.