smartweb 发表于 2016-1-25 10:23:37

日志小建议

网站打开了日志,担心日志文件会用尽硬盘,建议日志文件按七天滚动最大50M

smartweb 发表于 2016-1-25 10:27:35

rotatelogs

smartweb 发表于 2016-1-25 10:29:30

CustomLog "|/usr/sbin/rotatelogs /home/wwwlog/accesslog 5M" common

smartweb 发表于 2016-1-25 10:56:26

Incorrect number of arguments
Usage: /usr/local/apache/bin/rotatelogs [-l] [-f] <logfile> {<rotation time in seconds>|<rotation size in megabytes>}

Add this:

TransferLog "|/usr/local/apache/bin/rotatelogs /some/where 86400"

or

TransferLog "|/usr/local/apache/bin/rotatelogs /some/where 5M"

to httpd.conf. The generated name will be /some/where.nnnn where nnnn is the
system time at which the log nominally starts (N.B. if using a rotation time,
the time will always be a multiple of the rotation time, so you can synchronize
cron scripts with it). At the end of each rotation time or when the file size
is reached a new log is started.
页: [1]
查看完整版本: 日志小建议