Nginx is not stored in the date format as the file name. all logs are stored in the same name. for a long time, the log file will become very large. This is not conducive to analysis. Although nginx does not have this function, we can write a small script and schedule tasks to achieve this effect. Script... nginx is not stored in the date format as the file name. all logs are stored in the same name, and the log file will become very large for a long time. This is not conducive to analysis.
Although nginx does not have this function, we can write a small script and schedule tasks to achieve this effect.
The script code is as follows (cutn/usr/local/tool/cutnginxlog. sh)
#! /Bin/sh
# Program:
# Auto cut nginx log script.
#2012/2/5 b4dboy First release QQ: 137 51 52 53
Ps: If you want to analyze logs at a certain time, use the Navicat for MySQL import function to import nginx logs to mysql. Next, you just need to construct an SQL statement.
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