国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Apache > 正文

限制 Apache日志文件大小的方法

2024-08-27 18:30:05
字體:
來源:轉載
供稿:網友
通常我們是在{$apache}/conf/httpd.conf中設置Apache的參數,然而我們并沒有發(fā)現可以設置日志文件大小的配置指令,通過參考,可以用apache 自己的程序 rotatelogs.exe(位于 {$apache}/bin/目錄下),來限制日志文件的大小。
Usage: rotatelogs [-l] [offset minutes from UTC] or
Add this:
TransferLog "|rotatelogs /some/where 86400"
or
TransferLog "|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 synchronizecron scripts with it). At the end of each rotation time or when the file size is reached a new log is started.
在 Windows 下的設置例子如下:
# 限制錯誤日志文件為 1M
ErrorLog "|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 1M"
# 每天生成一個錯誤日志文件
#ErrorLog "|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 86400"
# 限制訪問日志文件為 1M
CustomLog "|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 1M" common
# 每天生成一個訪問日志文件
#CustomLog "|bin/rotatelogs.exe -l logs/access-%Y-%m-%d.log 86400" common
linux/Unix下 應該類似。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 馆陶县| 乌兰浩特市| 汾阳市| 水富县| 江油市| 龙川县| 方城县| 宁河县| 仙居县| 延安市| 枝江市| 闸北区| 康定县| 兰溪市| 仙游县| 太康县| 闽清县| 商南县| 阳泉市| 门头沟区| 南宫市| 新绛县| 香河县| 加查县| 灵川县| 贵德县| 城市| 绥宁县| 浠水县| 芒康县| 嘉黎县| 泌阳县| 新巴尔虎右旗| 渝北区| 宜昌市| 循化| 新邵县| 永宁县| 安阳市| 周宁县| 青神县|