tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: catalina.out rotation
Date Tue, 21 Oct 2008 13:27:26 GMT
emerson cargnin wrote:
> Hi again...
> 
> Has anyone here used Logadm to implement rotation on the catalina.out?
> http://www.softpanorama.org/Logs/log_rotation_in_solaris.shtml
> 
> I know i can rotate a log file configure via log4j, but that is
> useless if catalina.out continues receiving everything. Eliminating
> catalina.out is not an option as well as there are still too many
> system.out messages.
> 
Hi.
I have been battling with these logging issues in Tomcat for a while 
too, see the thread entitled "Appeal to Tomcat developers".

The following is more of a hack than a clean solution, but if you cannot 
get rid of catalina.out, and you can't rotate it, look at the way it is 
done in the attached startup script for Tomcat 5.5, part of that package 
for Linux Debian.  I have a feeling the Debian packager had the same 
issue, and found this as a solution.

Look at lines 132-140, and then at lines 142-156.

I have not really analysed in detail yet, but what seems to happen there 
is :
- delete catalina.out
- make catalina.out be a "fifo", with appropriate permissions
- start "rotatelogs" (a utility created for that purpose), taking as 
input the catalina.out fifo
- start Tomcat (which will write to catalina.out)

Thus, everything Tomcat writes to catalina.out will go as input to 
rotatelogs, which will rotate this according to how you set it up, and 
write it where you want.

Hope this helps.



Mime
View raw message