Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8876565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:14:31+00:00 2026-06-14T19:14:31+00:00

I am using Tomcat 7.x as my web server and I am using java.util.logging

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:14:32+00:00Added an answer on June 14, 2026 at 7:14 pm

    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.base to 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 work such as:

    class LogServlet extends HttpServlet
    {
       @Override
       protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
       {
          File logFile = new File(System.getProperty("catalina.base"), "logs/catalina.log");
          String contents = FileUtils.readFileToString(logFile);
          PrintWriter out = new PrintWriter(resp.getOutputStream());
          out.println(contents);
       }
    }
    

    I am using commons-io to simplify reading the log file, but otherwise it’s just the Java servlet framework.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I run my java web application from eclipse using tomcat server, system gets
I'm working on a Java-based web app using Tomcat 7.0 as the application server.
I am using apache tomcat as a web server. I have deployed webservices on
I am currently using tomcat 6 as my Web Server. I have a very
I have a Java web app running on Tomcat 7 that is using JDBC
I am using Tomcat and Java (through Eclipse) and SQL Server 2008 R2 I
I am running a web application using Tomcat and Java Servlets, JSP's, etc. I
I am using tomcat 6 web server to do some jsp stuff. If I
So I have a Tomcat server within a Java web application, authentication is done
I have a java web application wired using Spring on Tomcat. I need a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.