jigen studylog » 2008 » 6月

jigen, Hirotomo Kunimatsu
Tokyo, Japan
mailto: microformat hcard
top

lighttpd のログ設定

lighttpd のログ設定以前、lighttpdでURLをrewriteというエントリーで、lighttpdヴァーチャルホストの設定とURLリライトルールに関して書いたけど、アクセスログエラーログの設定が微妙に調べ切れなかったので、ちょっと調べてみた。

結局、設定名がエラーログと、アクセスログとで違う所が分かりにくくしている原因だった。

ここら辺に書いてあるんだけど、「accesslog.filename」をそのまま「error.filename」とかにするとエラーが出る。んで色々調べた結果「server.errorlog」という名前で設定すれば良かった。

以下に一応設定を書いておく、カスタムログの形式もここに書けるみたい。

$HTTP["host"] =~ "host\.example\.com" {
    accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-LIGHTTPD-SID}o\"",
    server.document-root = "/path/to/document-root/",
    server.errorlog = "/path/to/error.log",
    accesslog.filename = "/path/to/access.log",
    url.rewrite-once = (
        "^/css/(.+)?$" => "$0",
        "^/img/(.+)?$" => "$0",
        "^/(.+)?$" => "/index.php/$1"
    )
}

整理しておこう

アクセスログ
accesslog.filename = “/path/to/access.log” の形式で書く
エラーログ
server.errorlog = “/path/to/error.log” の形式で書く

というか、命名ルールをもうちょっと考えて欲しかったなぁ・・・。これバージョンアップとかで変わったりするとドヨーンとした気分になるぞ orz


2008/06/17 16:34:51200816:34
ネズミ「ここからメニューだすよ」
ネズミ「ごちそういっぱーい」
ネズミ「腹へったー」
ネズミ「働けー働けー♪」