TomcatExpert

How to configure log rotation in Apache Tomcat 5.5 and 6.0 using the Juli logging package

posted by SpringSource on March 18, 2010 11:46 PM

How to enable file rotation to periodically purge older log files and clear space using the default juli internal logging for Apache Tomcat.

By default, Apache Tomcat dies its internal logging through juli. The quantity of information stored in the log files on any server can quickly grow to be quite large. For instance, the access log file typically grows 1 MB or more per 10,000 requests. Therefore, it may be necessary to periodically rotate the log files by moving the files or deleting the existing logs to free up space on the server and allow for more efficient searching through logs. This cannot be done while the server is running, because Apache Tomcat will continue writing to the old log file as long as it holds the file open.

 To achieve this, in the logging.properties, add: 

.handlers = 1catalina.java.util.logging.FileHandler 
.level=FINE 
 
1catalina.java.util.logging.FileHandler.level = FINE 
1catalina.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/${catalina.appserver.instance}.%g.log 
1catalina.java.util.logging.FileHandler.limit = 2000000 
1catalina.java.util.logging.FileHandler.count = 5 
1catalina.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

where 1catalina.java.util.logging.FileHandler would instantiate the FileHandler that comes with JDK.

Since java.util.logging.FileHandler does not have .prefix or .directory, .prefix and .directory needs to be set in the catalina package:

1catalina.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/catalina.%g.log 

NOTE: The names have to be consistent everywhere, including in the handlers and .handlers references.

For further details, the JDK filehandler is documented at: http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/FileHandler.html

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

The "<handlers></handlers>"

The "<handlers></handlers>" seems confusing. Perhaps using the normal comment syntax is more appropriate:

####
# Define custom logging handlers
####

Thanks

Thanks for spotting that. Looks like a copy/paste error. I've fixed the logging.properties extract by removing those tags.

This is just another reason

This is just another reason why I like your work the best. Man, your work is sublime! You are always providing us with great, helpful informative articles. It's always a joy to read your articles. I hope you'll keep this good work going on! payday loans for bad credit in canada

obat stroke paling manjur

Obat Alami Ambeien Paling Tepat Untuk Diminum
Cara Mencegah Menggunakan amazon Plus Alami Obat Tradisional Wasir. Cara penyembuhan terbaik guna pencegahan ambeien dengan menjaga tinja tetap elastis agar bisa keluar dengan gampang, sehingga mengurangi tekanan & tegangan pada anus, selesaikan secepat mungkin setelah ada rangsangan buang air besar obat ambeien.

Stroke Dipulihkan, Badanpun fit berkat Obat Tradisional amazon
Jus Kulit Manggis Obat Alami Stroke dipercaya sudah banyak mengobati pasien storke yang mungkin sudah puluhan tahun dideritanya. Banyak cara lainnya untuk terhindar dari serangan penyakit stroke selain menggunakan Jus Kulit Manggis Obat Stroke, yaitu kegemukan, kolesterol tinggi, makanan kecil, serta mulailah lebih banyak makan buah-buahan, padi-padian dan makan makanan berserat tinggi lainnya serta ikan obat stroke paling manjur.

Solusi terbaru dan pertama di Asia Tenggara yang merupakan salah satu karya asli anak bangsa, yaitu obat Obat Tradisional Alami Penyakit Gondok “Jus Kulit Manggis”.
amazon Plus yaitu jawaban yang paling aman untuk mengatasi penyakit gondok, rasanya yang lezat & terjamin selama fase pengobatan bebas ada efek samping obat gondokan.

Time based log file rotation

Using JULI how would you configure log file rotation on daily or hourly basis.

Limiting catalina.out

Hi ,

I changed the logging.properties as mentioned in the post.
I believe it is working fine.
But catalina.out seems growing to unbelievable size.
How to limit and rotate it?
My logging.properties is as follows :

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.java.util.logging.FileHandler, 2localhost.java.util.logging.FileHandler, 3manager.java.util.logging.FileHandler, 4host-manager.java.util.logging.FileHandler, java.util.logging.ConsoleHandler

.handlers = 1catalina.java.util.logging.FileHandler

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

1catalina.java.util.logging.FileHandler.level = FINE
1catalina.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/catalina.%g.log
1catalina.java.util.logging.FileHandler.limit = 2000
1catalina.java.util.logging.FileHandler.count = 2
1catalina.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

2localhost.java.util.logging.FileHandler.level = FINE
2localhost.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/localhost.%g.log
2localhost.java.util.logging.FileHandler.limit = 2000
2localhost.java.util.logging.FileHandler.count = 2
2localhost.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

3manager.java.util.logging.FileHandler.level = FINE
3manager.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/manager.%g.log
3manager.java.util.logging.FileHandler.limit = 2000
3manager.java.util.logging.FileHandler.count = 2
3manager.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

4host-manager.java.util.logging.FileHandler.level = FINE
4host-manager.java.util.logging.FileHandler.pattern = ${catalina.base}/logs/host-manager.%g.log
4host-manager.java.util.logging.FileHandler.limit = 2000
4host-manager.java.util.logging.FileHandler.count = 2
4host-manager.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

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.java.util.logging.FileHandler

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

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.java.util.logging.FileHandler

# For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE

# To see debug messages in TldLocationsCache, uncomment the following line:
#org.apache.jasper.compiler.TldLocationsCache.level = FINE

and I ve done a small change to catalina.sh as per the blog here: http://www.ginnokagi.com/2012/08/tomcat_tuning_in_practice.html

What am I doing wrong here..?
When i comment out touch in line 372 as
#touch "$CATALINA_OUT"
catalina.out is not getting written at all.

Any ideas..
Thanks in advance,
Mohan
mohan@yatech.in

<a href="http://goo.gl/PbacCN">Lowongan</a>

Lowongan
HIT Obat Nyamuk
Nissan X-Trail Mobil SUV Tangguh dan Sporty Terbaik
Nissan X-Trail Mobil SUV Tangguh dan Sporty Terbaik

Cara Terbaru 

GAME HACK

8 ball pool hack android At this point you'll find out what is important, it all gives a url to the appealing page: free gems clash of clans

By standard, Apache Tomcat

By standard, Apache Tomcat passes away its inner signing through juli. The quantity of information held in the log information on any server can quickly grow to be quite large. For instance, the access log computer file typically develops 1 MB or more per 10,000 demands. Therefore, it may be necessary to regularly move the log information by moving the information or removing the current records to free up space on the server and allow for more efficient searching through records. This cannot be done while the server is running, because Apache Tomcat will continue writing to the old log computer file as long as it keeps the computer file open homepage.

By conventional, Apache

By conventional, Apache Tomcat goes away its inner selecting through juli. The quantity of information kept in the log information regarding any server can quickly turn into quite large. For example Homepage, the access log computer computer file generally generates 1 MB or more per 10,000 specifications.

By conventional, Apache

By conventional, Apache Tomcat passes away its inner selecting through juli. The quality of information kept in the log details on any server can quickly turn into quite large. For example pictures of funny dogs, the access log pc computer information file generally generates 1 MB or more per 10,000 specifications. Therefore, it may be necessary to continually move the log details by shifting the facts or taking out the current details to free up space on the server and allow for more effective looking through details.

By conventional, Apache

By conventional, Apache Tomcat passes away its inner choosing through juli. The quality of information kept in the log information regarding any server can quickly turn into quite large. For example pictures of insane animals, the access log pc pc information pc computer file generally generates 1 MB or more per 10,000 specifications. Therefore, it may be necessary to regularly go to website, move the log information by moving everything or taking out the current information to free up space on the server and allow for more effective looking through information.

By conventional, Apache

By conventional, Apache Tomcat goes away its inner choosing through juli. The quality of information kept in the log information on any server can quickly become quite huge. For example pictures of insane animals, the availability log pc pc information pc pc computer computer file usually generates 1 MB or more per had me going, 10,000 specifications. Therefore, it may be necessary to continually go to website, move the log information by moving everything or taking out the existing information to free up area on the server and allow for more valuable looking through information.

For example pictures of

For example pictures of insane animals Naruto Guide, the availability log pc pc information pc pc computer computer file usually generates 1 MB or more per 10,000 specifications. Therefore, it may be necessary to continually go to website.

By traditional, Apache Tomcat

By traditional, Apache Tomcat goes away its inner choosing through juli. The quality of information kept in the log particularly any server can easily become quite large hatha yoga certification.

By standard linked here,

By standard linked here, Apache Tomcat goes away its inner deciding upon through juli. The volume of details kept in the log details about any server can quickly grow to be quite large. For example, the access log computer file typically produces 1 MB or more per 10,000 requirements.

Dhaba Indian Excellence in Toronto

You bear through a awesome vacancy. I sanity definitely quarry it moreover personally suggest to my buddys. I am self-possessed they determination be benefited from this scene.
indian food toronto

Writing on the internet seo

Writing on the internet seo material is very different to traditional company composing promotion or composing press here are the findings.

By conventional, Apache

By conventional, Apache Tomcat dies its inner deciding upon through juli. The amount of data kept in the log info on any server can quickly turn into quite large. For example, the access log pc data file generally generates 1 MB or more per 10,000 requirements. Therefore, it may be necessary to consistently move the log details by moving the facts or eliminate the current details to free up space on the server and allow for more effective searching through details. This cannot be done while the server is running, because Apache Tomcat will continue writing to the old log pc data file as long as it keeps the pc pc data file open this contact form.

Venus Factor Reviews

These websites are really needed, you can learn a lot.
venusfactoreviews.co/the-3-week-diet-discover-the-most-effective-weight-loss-plan-by-brian-flat/

Gold Eagle

You have made an incredible showing. I will most likely burrow it and by and by propose to my companions. I am certain they will be profited from this site.
gold eagle

Another different aspect of

Another different aspect of artist watches is- they are not accumulation produced. Watches fabricated by acclaimed designers abide accepted for years. A being absent to resell a artist rolex Replica watches can get a college amount as the amount of rare, top end watches access with time. Rolex, Patek Philippe, Cartier, Piaget, Breguet are some of the accepted affluence watch brands.Bottom band - if you do your analysis and buy the appropriate pre-owned archetypal at a reasonable price, the amount of your watch will accordingly increase. Finally, the aloft comments apropos to amount acknowledgment are absolutely pertaining alone to pre-owned watches. Purchasing a new watch from a banker absolutely has its abode in agreement of warranty, condition, support, etc. But purchasing a new watch is absolutely like purchasing a new car, or maybe even worse. As anon as you leave the dealer, your new watch depreciates 25%. With a new watch, you may possibly see some aggrandized amount tag heuer Replica uk afterwards 10 or 20 years. But a pre- endemic alarm may appearance absolute accession in just 6-12 months in some cases. And affluence watches are finer anatomic jewelry. Humans buy big-ticket watches aboriginal and foremost because they accomplish them feel good.

http://www.rfshoeoutlets.co.uk

The quantity of your view may

The quantity of your view may appropriately improve. Lastly, the remarks apropos to quantity verification are definitely relating alone to pre owned watches. Investing in a fresh view from the bank definitely has its home in contract of guarantee, situation, assistance, Etc recommended you read.-But investing in a fresh view is like investing in a new-car completely, and maybe even worse. As anon while you abandon the seller, 25% are depreciated by your view.

I Fulfill a Strong

I Fulfill a Strong spell-caster and Psychic from Africa by title Doctor Think, He's Actual, Truthful and Genuine. He assisted me healed my H.I V. helps,he's a professional there's no poor or damaging effect.The Psychic uses bright Miracle he primary goal would be to heal HIV-AIDS he's a niche in his area, they can also heal your HIVAIDS ONLINE by throwing a cause on it together with his miracle it function just 2 nights after throwing it fleet tracker,from that evening your condition has ended and triumph and pleasure of living an appropriate existence is likely to be yours permanently,simply try to observe what DOCTOR THINK may do; provide him a try nowadays he's the clear answer to HIV/ products

You article is really helpful

You article is really helpful to me to know the method how to configure log rotation in Apache Tomcat 5.5 and 6.0 using the Juli logging package. sell reward points I think this is the proper and effective way to do this process.

how to clear up space on iphone

You have raised an important issue..Thanks for sharing..I would like to read more current affairs from this blog..keep posting.. how to clear up space on iphone

Muneer

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Hitchhiking in Patagonia

kitchen faucets review

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job!
kitchen faucets review

Muneer

This is a wonderful article. These type of articles keeps the users interest in the website. dessert recipes

umneer

if you are disturb to daily work then you can fix your personal appointment with me, guaranteed your mind is sharp after using my escorts service. thanks.. dental implants cost in india

phone psychics

I am so grateful for your post.Much thanks again. Really Great. phone psychics

Muneer

That is very interesting Smile I love reading and I am always searching for informative information like this. This is exactly what I was looking for. Thanks for sharing this great article .designs

Muneer

i read a lot of stuff and i found that the way of writing to clearifing that exactly want to say was very good so i am impressed and ilike to come again in future.. painter

online psychics

Your article simple and understandable. I am selecting a few key details, I think it would suit my ideas. Thank you. online psychics

happy new year 2016 shayari

This information offers with wonderful as well as helpful tips for that all men and women. As well as me personally. I find this post impressive as well as I need to state that I was literally fascinated myself by this. happy new year 2016 shayari

asian fruit blend

This blog post really grabbed my attention. With that said I am going to subscribe. Therefore I will get more updates on what you have to say. asian fruit blend

textmate2.org/does-text-your-ex-back-work-customer-reviews

You need to take part in a contest for one of the finest websites online. I'm going to recommend this web site! textmate2.org/does-text-your-ex-back-work-customer-reviews

best e cig uk

Awesome post on a tremendous blog! I would love to bookmark it if I could find the helpful content like this in the coming future too. best e cig uk

Muneer

This was really an interesting topic and I kinda agree with what you have mentioned here! premium weed

Free Social Blogging website for everyone!!!

You can't really say what is beautiful about a place, but the image of the place will remain vividly with you.Free Social Blogging website for everyone!!!

http://www.rjtedu.com/what-to-do-when-you-sedenly-realize-i-need

This is a very good post which I really enjoy reading. It is not every day that I have the possibility to see
something like this.http://www.rjtedu.com/what-to-do-when-you-sedenly-realize-i-need-a-girlfriend/

Muneer

if you are disturb to daily work then you can fix your personal appointment with me, guaranteed your mind is sharp after using my escorts service. thanks.. www.haveyouseenhim.com/

Muneer

if you are disturb to daily work then you can fix your personal appointment with me, guaranteed your mind is sharp after using my escorts service. thanks.. Internet-profits

If you should be disrupt to

If you should be disrupt to everyday work you can certainly repair your individual visit with me their explanation, assured the mind is not natural after utilizing my companions company.

mueer

You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site. learn more

I am always looking on the

I am always looking on the internet for content that can help me. There is obviously a lot to know about this see post. I think you created excellent quality factors in Functions also. Keep operating, excellent job!

muneer

I would like to thank you for the efforts you had made for writing this awesome article. the flat belly diet

stock photos

Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post. stock photos

Amazing and fascinating post

Amazing and fascinating post Continue Reading. Excellent points you have usually distributed to us. Cheers. Simply proceed creating this sort of article.

Muneer

These kind of articles are always attractive and I am happy to find so many good point here in the post writing is simply great thanks for sharing. keylogger for mac

Post new comment

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