VPS侦探论坛

 找回密码
 注册
查看: 4032|回复: 3

日志小建议

[复制链接]
发表于 2016-1-25 10:23:37 | 显示全部楼层 |阅读模式

网站打开了日志,担心日志文件会用尽硬盘,建议日志文件按七天滚动最大50M
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-1-25 10:27:35 | 显示全部楼层


rotatelogs
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-1-25 10:29:30 | 显示全部楼层

CustomLog "|/usr/sbin/rotatelogs /home/wwwlog/accesslog 5M" common
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 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>} [offset minutes from UTC]

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.
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 21:22 , Processed in 0.026144 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表