The moose likes Tomcat and the fly likes rotation of catalina logs per day Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "rotation of catalina logs per day" Watch "rotation of catalina logs per day" New topic

rotation of catalina logs per day

paramdeep Narang

Joined: Jul 11, 2011
Posts: 1


I want to rotate tomcat catalina logs per day.
Could you please tell me how to rotate logs and also how to use cronolog in it.

Paramdeep Singh
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 445

What do you mean by "rotate tomcat catalina logs"?

Maybe you have RollingFileAppender in mind. Check that out...

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

Catalina.out is just a dump from the java.utilities.logging service (JULI) to the Tomcat JVM's stdout file, which is redirected from the console by the Tomcat startup script.

To get that information to rotate, you'd need to reconfigure logging to use a true logging channel that has rotation capabilities. I don't remember if JULI has such a thing, though. Log4j does, although to use Log4j, you'd need to follow the instructions in the Tomcat docs on how to reconfigure logging, and IIRC, that includes actually doing a custom Tomcat build.

Or, if you're running in an environment that doesn't require 24x7 uptime, you can cheat. Shutdown Tomcat, move (rotate) the log using a shell script, restart Tomcat.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: rotation of catalina logs per day
It's not a secret anymore!