Apache Log Poll three methods

Source: Internet
Author: User
Tags apache log

Log polling

Method 1

Download Cronlog software

Cd/home/lvnian/tools

wget http://down1.chinaunix.net/distfiles/cronolog-1.6.2.tar.gz

Tar XF cronolog-1.6.2.tar.gz

CD cronolog-1.6.2

./configure

Make && make install

Ll/usr/local/sbin/cronolog

###### #3

Cronlog System self-bringing mode. Change access log in httpd.conf or httpd.vhost.conf to the following content

# # #按天轮询

Customlog "|/usr/local/sbin/cronolog/application/apache/logs/www.access_%y%m%d.log" combined

# #按周轮询

# #CustomLog "|/usr/local/sbin/cronolog/application/apache/logs/www.access_%w.log" combined

# #按小时轮询

# #CustomLog "|/usr/local/sbin/cronolog/application/apache/logs/www.access_%y%m%d%h.log" combined

######## #结果

[Email protected]_web logs]# ll/application/apache/logs/

Total 52

-rw-r--r--1 root root 598 Sep 10:50 Www.access_20150921.log



# # #方法2

# #系统自带的rotatelogs

# # #把httpd. conf or httpd.vhost.conf Access log changes to the following content

Customlog "| /application/apache/bin/rotatelogs/application/apache/logs/www.access_%y%m%d.log 86400 "combined

# #重启http服务就可以了


/application/apache/bin/apachectl-t

/ETC/INIT.D/HTTPD restart

Netstat-lnt

Ll/application/apache/logs



Method 3:

Scheduled Task cutting

cd/application/apache/logs/

MV Www-access.log www-access_$ (date +%f). log

/application/apache/bin/apachectl Graceful


This article is from the "Technology Change Destiny" blog, please be sure to keep this source http://lvnian.blog.51cto.com/7155281/1696674

Apache Log Poll three methods

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.