最令人感興趣的就是可以使用一個簡單的工具cronolog來自動分割Apache日誌。
我的系統為Windows 2000 Server利用Appserv v2.4.0 架設,設定步驟如下:

1. 下載cronolog的win32 version,我下的是唯一一個win32版v1.6.1,
解壓後將cronolog.exe複製到Apache的bin目錄下:
 D:AppServapacheincronolog.exe。

2.編輯Apache的D:AppServapacheconfhttpd.conf,將
CustomLog logs/access.log combined
修改為
CustomLog "|d:/AppServ/apache/bin/cronolog.exe d:/AppServ/apache/logs/access%Y%m%d.log" combined 

3.如此一來,logs檔案將會每天儲存為一個檔案。

P.S 
ErrorLog logs/error.log 也可以改成 
ErrorLog "|d:/AppServ/apache/bin/cronolog.exe d:/AppServ/apache/logs/error%Y%m%d.log" 
____________________________________________________________________________________________
官方原始的INSTALL文檔如下:
Basic Installation
==================

Important note:
You need the apache version 1.3.13-dev as minimum. The support of
piped call of external programs appears in this version the first
time. All prior version can not spawn the cronolog process.



You need to copy the cronolog.exe to a directory. The best place is
your apache bin directory. Then you can configure the apache server
configuration file to use convlog for dynamic log file splitting.

Configuration for use with NT service:
TransferLog "|c:/apache/bin/convlog.exe c:/apache/logs/access%Y%m%d.log"

Configuration for use from command line:
TransferLog "|c:/apache/bin/convlog.exe c:/apache/logs/access%%Y%%m%%d.log"

I do not know why the command line version requires different
parameters. I filled a big report at the apache bug database.

The configuration of cronolog for windows supports ONLY the short
configuration options. I did not found a getopt_long() function
equivalent for windows. Please mail me if you find it.

Klaus Mueller
k.mueller@intershop.de
文章標籤
全站熱搜
創作者介紹
創作者 buywater 的頭像
buywater

WaTeR°先生的相片日記

buywater 發表在 痞客邦 留言(0) 人氣(465)