2

I am not able to locate the tomcat log files on ubuntu. I looked into /var/log/tomcat6 but the output are these file,

catalina.2012-11-23.log  catalina.out       localhost.2012-11-23.log
catalina.2012-11-24.log  catalina.out.1.gz  localhost.2012-11-24.log

Any idea which is the correct one?

Sam007
  • 4,653

2 Answers2

2

I usually find any files using file command and filter the results using grep. It helps on many situation. For your case it is possible that your tomcat6 log file would be located in some other place.

So you can use following command to locate it, you would get few results then it would be easier to look the actual path:

sudo find / -type f | grep tomcat| grep log

For example if I want to find all the log files of apache2 then I have to execute this (I don't have tomcat installed, so giving apache2 example):

sudo find / -type f | grep apache2 | grep log

I got this:

/var/log/apache2/access.log.7.gz
/var/log/apache2/error.log.1
/var/log/apache2/error.log.9.gz
/var/log/apache2/error.log.3.gz
/var/log/apache2/access.log.1
/var/log/apache2/error.log.6.gz
/var/log/apache2/error.log.7.gz
/var/log/apache2/error.log
/var/log/apache2/error.log.2.gz
/var/log/apache2/error.log.5.gz
/var/log/apache2/access.log.2.gz
/var/log/apache2/access.log.4.gz
/var/log/apache2/access.log.9.gz
/var/log/apache2/error.log.8.gz
/var/log/apache2/error.log.4.gz
/var/log/apache2/access.log.6.gz
/var/log/apache2/other_vhosts_access.log
/var/log/apache2/access.log.8.gz
/var/log/apache2/access.log.5.gz
/var/log/apache2/access.log
/var/log/apache2/access.log.3.gz
/usr/lib/apache2/modules/mod_log_forensic.so
/usr/share/doc/apache2.2-bin/changelog.Debian.gz
/usr/share/doc/apache2-utils/changelog.Debian.gz
/etc/apache2/mods-available/log_forensic.load
/etc/apache2/conf.d/other-vhosts-access-log
/etc/logrotate.d/apache2

Now it is easier to locate all log of apache2 like error , access etc.. You can use more filter to cascade some more results..

Hope you would be able to locate your tomcat6 log file..

Saurav Kumar
  • 15,174
1

Catalina.out is the file you are looking for. In order to view log on terminal , you can use
tail -f /var/log/tomcat6/catalina.out