Window Apache Log Split

Source: Internet
Author: User
Tags apache log

Apache [httpd.conf] configuration file

#ErrorLog "Logs/error.log"

Errorlog "|bin/rotatelogs.exe-l logs/error-%y-%m-%d.log 2M"

Log cutting for virtual hosts under Windows

<virtualhost *:>    ServerAdmin [email protected    ]"d:/wamp/www "     ServerName localhost    "logs/localhost-error.log "      "logs/localhost-access.log"  common</VirtualHost>

After the change

<virtualhost *:>    ServerAdmin [email protected    ]"d:/wamp/www "     ServerName localhost    "|bin/rotatelogs.exe-l Logs/localhost-error-%y-%m.log 86400"  "    |bin/rotatelogs.exe-l logs/localhost-access-%y-% M.log"  common</VirtualHost>

or use the following

locate errorlog logs in the Apache configuration file/Error_logcustomlog Logs/Access_log Commonlinux System Configuration method: Change it to errorlog"|/usr/local/apache/bin/rotatelogs/home/logs/www/%y_%m_%d_error_log 86400 480"Customlog"|/usr/local/apache/bin/rotatelogs/home/logs/www/%y_%m_%d_access_log 86400 480"commonwindows System Configuration method: #ErrorLog"|bin/rotatelogs.exe logs/vicp_net_error-%y%m%d.log 86400 480"#CustomLog"|bin/rotatelogs.exe logs/vicp_net_access-%y%m%d.log 86400 480"Common for the first time do not know set 480 this parameter, resulting in a log record time and server time difference of 8 hours, the original is Rotatelogs has an offset parameter, the number of minutes relative to UTC, China is the eighth time zone, the difference of 480 minutes. 86400 is a 1-day representation. 

Window Apache Log Split

Related Article

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.