Log Scrolling Tool

Source: Internet
Author: User
Tags apache access log apache log

Why use this tool: when the Apache access log is not scrolling by default, when the access log is too large, the analysis of the log is inconvenient, open may be directly on the wait for 1

Hours!!

Logrotate is a log-cutting tool for most Linux systems, with a configuration file of/etc/logrotate.conf that simply defines an instance of the Apache log cut:

Vim/etc/logrotate.d/apache

How many logs can rotate keep

Notifempty if it's an empty file, don't dump it.

Daily Daily Dump

Missingok if the specified directory does not exist, Logrotate will error, which is used to close the error

A size file is dumped at 50M

Sharedscripts All log files are rotated once the script is executed uniformly

Postrotate/endscript: Commands that need to be executed after the dump can be placed in this pair, these two keywords must be taken separately

Delaycompress: When used with compress, the dump log file is compressed until the next dump

-f/var/run/nginx/nginx.pid confirm that Nginx is started

KILL-USR1 ' Cat/var/run/nginx/nginx.pid ' is not a process that aborts nginx, but is passed to it to generate a signal to regenerate the log

Log Scrolling Tool

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.