Apache Log Rotation rules

Source: Internet
Author: User
Tags apache log

Linux: |/usr/local/sbin/cronolog/web/apache/logs/%y%m%daccess_log

<ifmodule log_config_module>
#
# The following directives define some format nicknames for use with
# a customlog directive (see below).
#
Logformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ ""
Logformat "%h%l%u%t \"%r\ "%>s%b" Common

<ifmodule logio_module>
# need to enable MOD_LOGIO.C to Use%I And%O
Logformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "%I%O" Combinedio
</IfModule>

#
# The location and format of the access logfile (Common logfile format).
# If You don't define any access logfiles within a <VirtualHost>
# container, they'll be logged Here. contrariwise, If you *do*
# define per-<virtualhost> access logfiles, transactions'll be
# logged therein and *not* in the This File.
#
Transferlog "|/usr/local/sbin/cronolog/web/apache/logs/%y%m%daccess_log"

#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) You can use the following Directive.
#
#CustomLog "logs/access_log" combined
</IfModule>

Apache logs by time-phased recording
Found in Apache configuration file httpd.conf
Errorlog Logs/error_log and Customlog Logs/access_log common
Linux 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″common
Configuration method under Windows System:
Errorlog "|bin/rotatelogs.exe Logs/site1/error-%y%m%d.log 86400 480″
Customlog "|bin/rotatelogs.exe Logs/site1/access-%y%m%d.log 86400 480″common
Where common is the name set in the log record format. Reference Link: http://www.server110.com/apache/201309/1869.html

Apache Log Rotation rules

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.