instaweb: add access+error logging for WEBrick
authorEric Wong <normalperson@yhbt.net>
Thu, 5 Aug 2010 08:46:04 +0000 (08:46 +0000)
committerEric Wong <normalperson@yhbt.net>
Thu, 5 Aug 2010 08:51:26 +0000 (08:51 +0000)
This allows WEBrick to support all the logging functionality
in a manner consistent with the other web servers.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-instaweb.sh

index e69fb74fef11dbcd25f4dce1beb2e65a97f59e94..e6f6ecda177c66a79b18359f7bf8cad9c4744c8c 100755 (executable)
@@ -216,9 +216,15 @@ EOF
        cat >"$fqgitdir/gitweb/$httpd.rb" <<EOF
 #!/usr/bin/env ruby
 require 'webrick'
+require 'logger'
 options = {
   :Port => $port,
   :DocumentRoot => "$root",
+  :Logger => Logger.new('$fqgitdir/gitweb/error.log'),
+  :AccessLog => [
+    [ Logger.new('$fqgitdir/gitweb/access.log'),
+      WEBrick::AccessLog::COMBINED_LOG_FORMAT ]
+  ],
   :DirectoryIndex => ["gitweb.cgi"],
   :CGIInterpreter => "$wrapper",
   :StartCallback => lambda do