Close Tomcat's Access_log

Source: Internet
Author: User
Tags tomcat server

Close Tomcat's Access_log

After building the Tomcat server, running a period of time will generate a large number of logs, resulting in insufficient disk space, when looking for analysis found "Localhost_access_log" log occupies a lot of space, view the contents of the log found that the log is the client's access information, This includes information such as client IP, time, access to resources, and so on.


10.11.2.3 10.11.2.13--[17/nov/2015:17:20:43 +0800] "get/http/1.1" 200 11418


You can turn off logging when the log is not needed:

Found in Server.xml:

<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"

prefix= "Localhost_access_log" suffix= ". txt"

pattern= "%{x-forwarded-for}i%h%l%u%t &quot;%r&quot; %s%b "/>

To comment out this paragraph:

<!--

<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"

prefix= "Localhost_access_log" suffix= ". txt"

pattern= "%{x-forwarded-for}i%h%l%u%t &quot;%r&quot; %s%b "/>

-

Restart the Tomcat service after saving, without worrying about the lack of space.

This article is from the "humble Words" blog, please be sure to keep this source http://fhjx1234.blog.51cto.com/1022919/1713608

Close Tomcat's Access_log

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.