I have tomcat 7 running on my server. accidentally my catalina.out replaced with an old log(catalina.out before 7 days). Log is not printing on current catalina.out because it is an old one. Is there anyway to rollback this situation or create a catalina.out without restarting the server?
-
no, you need to restart – Vorsprung May 19 '15 at 10:05
-
Thank you Vorsprung.. So it seems restarting is the only way? – shashika May 19 '15 at 12:58
1 Answers
If the catalina.out
is deleted after tomcat
is stopped, it will create a new catalina.out
once tomcat
starts and writes to it. But in your case, since catalina.out
was replaced while tomcat
was running it is holding up the original catalina.out
file reference and writing to the deleted file. The reason why it is logging into your old catalina.out file.
You can get rid of this by restarting the tomcat
server.
Since you have replaced the new catalina.out with old catalina.out it is impossible to rollback. Going forward try to use logrotate
tool in Linux
. It is a log managing command-line tool
in Linux. This can rotate the log files under different conditions.
Particularly, we can rotate log files on a fixed duration or if the
file has grown to a certain size. You can click here for more
info on this.

- 11,530
- 2
- 71
- 51