Hi > > > What should happen when catalina.out is deleted? Please, I need to > > > resolve this question. > > So far as I know it's just a logfile and all that happens is that you > > lost the log output. The file should be created on the next start of > > the server. > Even when the server is running and the file is deleted? Thank you.
If you are running on linux (which I suppose is true, if you are calling gzip catalina.out), the file was not actually deleted. The tomcat process opened that file and kept it open. Gzip read the file, and *unlinked* it, which is actually a delete if and only if there is no other link. However, as tomcat still has an active file handle, there is. So tomcat keeps logging into a file that is not accessible as "catalina.out" any more. As long as tomcat is running, you can (at least as root) access that file anyway: 1. Find the process id of the process writing the log (tomcat) 2. List /proc/<id>/fd to see which file handle it is (usually 1 and 2 for catalina.out) 3. Copy the log using the file handle. For example from my server: root@www:~# rm /isp/logs/tomcat/catalina.out root@www:~# pgrep java 4690 root@www:~# ls -al /proc/4690/fd | grep catalina.out l-wx------ 1 root root 64 2012-11-29 19:17 1 -> /isp/logs/tomcat/catalina.out (deleted) l-wx------ 1 root root 64 2012-11-29 19:17 2 -> /isp/logs/tomcat/catalina.out (deleted) root@www:~# copy /proc/4690/fd/1 /root/logsaved WARNING: As soon as you restart tomcat, the last reference to the unlinked file will be gone and linux will remove the file for good. Regards, Steffen
smime.p7s
Description: S/MIME cryptographic signature