0

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?

Du-Lacoste
  • 11,530
  • 2
  • 71
  • 51
shashika
  • 1
  • 1

1 Answers1

0

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.

Du-Lacoste
  • 11,530
  • 2
  • 71
  • 51