I am using Tomcat 7.x as my web server and I am using java.util.logging and JULI for logging. This Tomcat server is hosted an Amazon EC2 instance which runs Ubuntu.
The Problem is whenever I wish to see the logs (in catalina.log file) I have go through a very time consuming process of copying, chowing and then downloading the files to my local machine before I can see them. (I can use utilities like nano or vi but they do not help much)
My Question Can I automatically exports the logs to some external server and view them straight away. Some thing similar to Bugsense for ACRA reports in Android.
You could create a servlet to run in Tomcat to read the logs and display them in your web browser. Or if the file is large, zip it up and allow you to download it.
Use the environment variable
catalina.baseto determine the base directory and then gather up logs/catalina.log.[update]
The best approach would depend on your background. If you are comfortable doing a basic, no-frills servlet, start with
the simplest design that could possibly worksuch as:I am using commons-io to simplify reading the log file, but otherwise it’s just the Java servlet framework.