How to configure Apache Log scrolling in windows to solve the problem of too many log files

Source: Internet
Author: User
Tags apache log

Apache Log scrolling configuration in windows solves the problem of too many log files. By default, apache logs are written into two log files, namely, error. log and access. log, as files continue to expand, when 2 GB or more, the apache service itself may have some unstable performance, and the troubleshooting of such errors is quite difficult, because it is hidden. There are many ways to scroll up apache logs on www.2cto.com, but most of them use linux as an example. However, this configuration method cannot be directly obtained in windows, for example, httpd in apache in linux. conf is written as follows: CustomLog logs/access. log common ErrorLog logs/error. log note that the preceding two are not consecutive. Configuration method in linux:
CustomLog "| bin/rotatelogs logs/access-% y-% m-% d-% H _ % M _ % S. log 20 M" common is written in windows:
CustomLog "| bin/rotatelogs.exe logs/access-% y-% m-% d-% H _ % M _ % S. log 20 M "common syntax. Here, the extension .exe of the rotatelogs program is also included in windows, and there is no extension in unix systems. Www.2cto.com may be confusing, including: 1. In configuration, even in windows, the directory separator must also be set to "/" instead of "\" 2. The relative path writing mode is supported in unix and windows. My configuration is CustomLog logs/access. change log common to CustomLog "| bin/rotatelogs.exe logs/access-% y-% m-% d-% H _ % M _ % S. log 10 M "common www.2cto.com ErrorLog logs/error. change log to ErrorLog "| bin/rotatelogs.exe logs/access-% y-% m-% d-% H _ % M _ % S. log 10 M"

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.