Linux log processing

Source: Internet
Author: User

1. Apache Access log processing, using Cronolog.

2. Nginx Log Processing:

Use the restart Nginx to achieve log cutting.

Ideas:

MV Nginx.log Nginx-${data}-nginx.log

./nginx/sbin/nginx-s Reload


3. Nginx does not log unnecessary logs, films, videos and so on.

Location ~.\. (js|jpg|jpeg|mp4|css|bmp|gif) $ {

Access_log off;

}


4. Apache does not record unnecessary logs, slices, videos, etc.

Use the FilesMatch Settings tab to make a match.

Cases:

<filesmatch "\. (css|js|gif|jpg|ico|swf) ">

SetEnv IMAG 1

</FilesMatch>


Custonlog "|/usr/local/sbin/cronolog /usr/local/apache/logs/%y%m%d%h_log"

Combined env=! IMAG


5.








Linux log processing

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.