Make the Tomcat log Web page appear

Source: Internet
Author: User

To make a long story short, there are many ways to display the Tomcat logs on a Web page, which can be achieved by using different software, but the simplest is to be done in a few local commands.


The same partition can be implemented with hard links.

First look at your Web root directory: Vim tomcat/conf/server.xml find the <context docbase= "* * * * * * * * * * * * * * * * and enter its root directory, execute ln/usr/local/tomcat/logs in the root directory. /catalina.out. This will generate a catalina.out link file in your current directory, and restarting Tomcat can be done by entering it in the browser: IP address: 8080/catalina.out.


Soft Connection Implementation Method

Enter the Tomcat/conf/context.xml to change <Context> into

<context allowlinking= "true" > otherwise it won't show up in the webpage.


If the log file is too large to specify how many rows to look at, then do a scheduled task:

*/1 * * * * tail-n 200/usr/local/tomcat/logs/catalina.out >/web root directory/link file name

This means that every minute the log file is updated to the specified link file

This article is from the "11422312" blog, please be sure to keep this source http://11432312.blog.51cto.com/11422312/1793666

Make the Tomcat log Web page appear

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.