For some specific reason I need to retain both my app specific log and catalina.log. I have configured log4j to use RollingFileAppender for my app specific logs and it is working fine. Is there any way to use similar logging mechanism for catalina.logs also.
Can I do this by somehow tweaking the logging.properties under conf.
You can use logrotate. If you run ubuntu.
Create this file
Copy the following contents into the above file
}
Make sure that the path /var/log/tomcat/catalina.out above is adjusted to point to your tomcat’s catalina.out
daily – rotates the catalina.out daily
rotate – keeps at most 7 log files
compress – compresses the rotated files
size – rotates if the size of catalina.out is bigger than 5M
Thats it.