aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "rotation of catalina logs per day" Watch "rotation of catalina logs per day" New topic
Author

rotation of catalina logs per day

paramdeep Narang
Greenhorn

Joined: Jul 11, 2011
Posts: 1


Hi,

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.


Regards
Paramdeep Singh
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

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

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

Cheers,
Raj.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: rotation of catalina logs per day