I have installed Tomcat 7 on an Amazon EC2 running Amazon Linux. I have installed a WAR file on tomcat and I am using java.util.logging for logging messages in my code. Now how to access those log messages in Amazon EC2?


The standard location for Tomcat log files is:

  • There is folder tomcat7 at the location you suggested but I cannot cd into it. How do I access log file? – Gaurav Agarwal Jul 3 '12 at 19:46
  • 2
    Try to su as root user first: su -, or use sudo before your commands, e.g.: sudo ls -al /var/log/tomcat7 to see the directory content. – David Levesque Jul 3 '12 at 19:55
  • Thanks, it worked. If I may ask which file will have Log.log() from my Servlets. – Gaurav Agarwal Jul 3 '12 at 20:16
  • 2
    I would look in catalina.out first or one of the files starting with localhost. If you still don't find it, you can sort the files by date using ls -ltr to see the ones recently modified. – David Levesque Jul 3 '12 at 20:20
  • I have asked a related question here superuser.com/questions/444572/… – Gaurav Agarwal Jul 3 '12 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.